Annotation Interface ListenTo


@Retention(RUNTIME) @Target(METHOD) public @interface ListenTo
Used to annotate a listener method.
 
 @Component
 public class MyListeners {     
   @ListenTo(value = "${examples.say.hello.queue}")
   @SendTo("${examples.say.hello.result.queue}")
   public String sayHello(String msg) {
     return "Hello, "+msg;
   }
 }
 
 
Author:
John Bryant
  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
    The Queue name to listen too.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    boolean
    This parameter governs the ability to auto-acknowledge messages by defaulting to true.
    int
    Maximum threads used for listening to this queue.
    int
    Minimum threads used for listening to this queue.
    long
    The polling is the manager thread wake period.
    long
    The timeout value for the listener
    Providing a name for the field you want to place your custom Transaction ID means that Qcat can pass this value through for you and make it available via the Session object.
  • Element Details

    • value

      String value
      The Queue name to listen too.
      Returns:
      the queue name
    • min

      int min
      Minimum threads used for listening to this queue. Default is 1.
      Returns:
      the minimum active threads
      Default:
      1
    • max

      int max
      Maximum threads used for listening to this queue. Default is 1 and is probably NOT production ready.
      Returns:
      the maximum thread count
      Default:
      1
    • timeout

      long timeout
      The timeout value for the listener
      Returns:
      the timeout value in milliseconds
      Default:
      0L
    • polling

      long polling
      The polling is the manager thread wake period. This can bet turned to reduce CPU or increase recycling of worker threads. Be careful as a lower number doesn't mean faster recycling as the runtime for the threads will almost always be longer that teh poll time.
      Returns:
      the long value for the polling interval in milliseconds
      Default:
      10L
    • acknowledge

      boolean acknowledge
      This parameter governs the ability to auto-acknowledge messages by defaulting to true. Set this to false to handle and then in the listener methods you can manually acknowledge by changing the value in the Session object.
      Returns:
      the boolean value of the auto-acknowledge function
      Default:
      true
    • transactionId

      String transactionId
      Providing a name for the field you want to place your custom Transaction ID means that Qcat can pass this value through for you and make it available via the Session object.
      Returns:
      the name of the attribute that contains the transaction ID
      Default:
      ""