Class JmsConsumer

java.lang.Object
io.micronaut.jms.templates.JmsConsumer

public class JmsConsumer extends Object
Helper class that receives messages, configuring JMS connections, sessions, etc. for you. TODO rename with JmsProducer
Since:
1.0.0
Author:
Elliott Pope
  • Constructor Details

  • Method Details

    • receive

      public <T> T receive(@NonNull @NonNull String destination, Class<T> clazz)
      Receives a Message from the broker and and converts it to an instance of type <T>.
      Type Parameters:
      T - the class type
      Parameters:
      destination - the queue or topic name
      clazz - the class
      Returns:
      the message from the broker as an object instance of type <T>.
    • receive

      public javax.jms.Message receive(@NonNull @NonNull String destination)
      Receives a Message from the broker.
      Parameters:
      destination - the queue or topic name
      Returns:
      the message
    • toString

      public String toString()
      Overrides:
      toString in class Object