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
ConstructorsConstructorDescriptionJmsProducer(JMSDestinationType type, JMSConnectionPool connectionPool, Serializer serializer) JmsProducer(JMSDestinationType type, JMSConnectionPool connectionPool, Serializer serializer, boolean sessionTransacted, int sessionAcknowledgeMode) -
Method Summary
Modifier and TypeMethodDescriptionvoidsend(@NonNull String destination, @NonNull javax.jms.Message message, @io.micronaut.core.annotation.NonNull long timeToLive, MessageHeader... headers) Sends the givenmessageto thedestinationwith the givenheaders.voidsend(@NonNull String destination, T body, @io.micronaut.core.annotation.NonNull long timeToLive, MessageHeader... headers) Creates aMessagefrom thebodyand sends it to thedestinationwith theheaders.voidsend(@NonNull javax.jms.Destination destination, @NonNull javax.jms.Message message, @io.micronaut.core.annotation.NonNull long timeToLive, MessageHeader... headers) Sends the givenmessageto thedestinationwith 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 aMessagefrom thebodyand sends it to thedestinationwith 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 givenmessageto thedestinationwith 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 givenmessageto thedestinationwith the givenheaders.- Parameters:
destination- the queue or topic namemessage- the messagetimeToLive- time to live parameter in millisecondsheaders- optional headers
-
toString
-