Class JmsProducer<T>

java.lang.Object
io.micronaut.jms.templates.JmsProducer<T>
Type Parameters:
T - the message type

public class JmsProducer<T> extends Object
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 Details

  • Method Details

    • send

      public void send(@NonNull @NonNull String destination, @NonNull T body, @NonNull @io.micronaut.core.annotation.NonNull long timeToLive, MessageHeader... headers)
      Creates a Message from the body and sends it to the destination with the headers.
      Parameters:
      destination - the queue or topic name
      body - the body
      timeToLive - time to live parameter in milliseconds
      headers - optional headers
    • send

      public void send(@NonNull @NonNull String destination, @NonNull @NonNull jakarta.jms.Message message, @NonNull @io.micronaut.core.annotation.NonNull long timeToLive, MessageHeader... headers)
      Sends the given message to the destination with the given headers.
      Parameters:
      destination - the queue or topic name
      message - the message
      timeToLive - time to live parameter in milliseconds
      headers - optional headers
    • send

      public void send(@NonNull @NonNull jakarta.jms.Destination destination, @NonNull @NonNull jakarta.jms.Message message, @NonNull @io.micronaut.core.annotation.NonNull long timeToLive, MessageHeader... headers)
      Sends the given message to the destination with the given headers.
      Parameters:
      destination - the queue or topic name
      message - the message
      timeToLive - time to live parameter in milliseconds
      headers - optional headers
    • toString

      public String toString()
      Overrides:
      toString in class Object