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, @io.micronaut.core.annotation.NonNull long timeToLive, MessageHeader... headers) Sends the givenmessage
to thedestination
with the givenheaders
.void
send
(@NonNull String destination, T body, @io.micronaut.core.annotation.NonNull long timeToLive, 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, @io.micronaut.core.annotation.NonNull long timeToLive, 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
public void send(@NonNull @NonNull String destination, @NonNull T body, @NonNull @io.micronaut.core.annotation.NonNull long timeToLive, MessageHeader... headers) Creates aMessage
from thebody
and sends it to thedestination
with theheaders
.- Parameters:
destination
- the queue or topic namebody
- the bodytimeToLive
- time to live parameter in millisecondsheaders
- optional headers
-
send
public void send(@NonNull @NonNull String destination, @NonNull @NonNull javax.jms.Message message, @NonNull @io.micronaut.core.annotation.NonNull long timeToLive, MessageHeader... headers) Sends the givenmessage
to thedestination
with the givenheaders
.- Parameters:
destination
- the queue or topic namemessage
- the messagetimeToLive
- time to live parameter in millisecondsheaders
- optional headers
-
send
public void send(@NonNull @NonNull javax.jms.Destination destination, @NonNull @NonNull javax.jms.Message message, @NonNull @io.micronaut.core.annotation.NonNull long timeToLive, MessageHeader... headers) Sends the givenmessage
to thedestination
with the givenheaders
.- Parameters:
destination
- the queue or topic namemessage
- the messagetimeToLive
- time to live parameter in millisecondsheaders
- optional headers
-
toString
-