Package net.subnoize.qcat.listen
Annotation 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 -
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionbooleanThis parameter governs the ability to auto-acknowledge messages by defaulting to true.intMaximum threads used for listening to this queue.intMinimum threads used for listening to this queue.longThe polling is the manager thread wake period.longThe timeout value for the listenerProviding 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 valueThe Queue name to listen too.- Returns:
- the queue name
-
-
-
min
int minMinimum threads used for listening to this queue. Default is 1.- Returns:
- the minimum active threads
- Default:
- 1
-
max
int maxMaximum 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 timeoutThe timeout value for the listener- Returns:
- the timeout value in milliseconds
- Default:
- 0L
-
polling
long pollingThe 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 acknowledgeThis 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 transactionIdProviding 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:
- ""
-