Package io.micronaut.jms.templates
Class JmsProducer<T>
java.lang.Object
io.micronaut.jms.templates.JmsProducer<T>
- Type Parameters:
T
- the message type
Helper class that sends messages, configuring JMS connections, sessions,
etc. for you.
TODO rename, too similar to JMSProducer
- Since:
- 1.0.0
- Author:
- Elliott Pope
-
Constructor Summary
ConstructorDescriptionJmsProducer
(JMSDestinationType type, JMSConnectionPool connectionPool, Serializer serializer) JmsProducer
(JMSDestinationType type, JMSConnectionPool connectionPool, Serializer serializer, boolean sessionTransacted, int sessionAcknowledgeMode) -
Method Summary
Modifier and TypeMethodDescriptionvoid
send
(@NonNull String destination, @NonNull javax.jms.Message message, MessageHeader... headers) Sends the givenmessage
to thedestination
with the givenheaders
.void
send
(@NonNull String destination, T body, MessageHeader... headers) Creates aMessage
from thebody
and sends it to thedestination
with theheaders
.void
send
(@NonNull javax.jms.Destination destination, @NonNull javax.jms.Message message, MessageHeader... headers) Sends the givenmessage
to thedestination
with the givenheaders
.toString()
-
Constructor Details
-
JmsProducer
public JmsProducer(JMSDestinationType type, JMSConnectionPool connectionPool, Serializer serializer) -
JmsProducer
public JmsProducer(JMSDestinationType type, JMSConnectionPool connectionPool, Serializer serializer, boolean sessionTransacted, int sessionAcknowledgeMode)
-
-
Method Details
-
send
Creates aMessage
from thebody
and sends it to thedestination
with theheaders
.- Parameters:
destination
- the queue or topic namebody
- the bodyheaders
- optional headers
-
send
public void send(@NonNull @NonNull String destination, @NonNull @NonNull javax.jms.Message message, MessageHeader... headers) Sends the givenmessage
to thedestination
with the givenheaders
.- Parameters:
destination
- the queue or topic namemessage
- the messageheaders
- optional headers
-
send
public void send(@NonNull @NonNull javax.jms.Destination destination, @NonNull @NonNull javax.jms.Message message, MessageHeader... headers) Sends the givenmessage
to thedestination
with the givenheaders
.- Parameters:
destination
- the queue or topic namemessage
- the messageheaders
- optional headers
-
toString
-