On 10 May 2018 at 22:28, Abhishek Kumar
<[email protected]> wrote:
> Hi Team,
>
> I am using Qpid Java sending and receiving message. For sending any
> message, i need to create JMS message. At this moment, i am creating JMS
> message with the use of session. I want to avoid using session for creating
> message.

What is it that makes you want to avoid using the
Session#createMessage() message factories?  One of Session's many
stated purposes [1] is to be a source of "provider-optimized message
factories". The JMS standard does not define an alternative.  Why try
and work against this?

If you don't want to see the Message objects in your code for some
reason, you could consider the "simplified API" in JMS 2.0 which lets
you send a message by passing only the payload object [2].  Oracle's
example [3] illustrates the differences between the JMS 1.1 and 2.0
API in this respect.  See Listing 2.

[1] https://docs.oracle.com/javaee/7/api/javax/jms/Session.html
[2] 
https://docs.oracle.com/javaee/7/api/javax/jms/JMSProducer.html#send-javax.jms.Destination-java.util.Map-
[3] http://www.oracle.com/technetwork/articles/java/jms20-1947669.html

>
> I know one way to use ActiveMQMessage, but for this i need to use active-mq
> library which i want avoid due adding more dependency.
>
> Could you please suggest any better way to create JMS Message without JMS
> session?
>
>
> Regards,
> Abhishek Kumar

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to