Annotation Interface WampListener


@Target(METHOD) @Retention(RUNTIME) @Documented public @interface WampListener
Annotation that denotes a method that is called when the Broker receives a PublishMessage and the topic matches one of the listed values of the annotation ( topic()). If no topic is provided the method listens for the topic 'beanName.methodName'

The method feed in the following example listens for PublishMessage that are sent to the topic 'myService.feed'.

The method publishNews is called by the library when a PublishMessage with the topic 'topic.news' arrives.

 @Service
 public class MyService {

        @WampListener
        public void feed() {
        }

        @WampListener("topic.news")
        public void publishNews(String news) {
        }
 }
 
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Specifies the match policy
    One or more topics the method should listen on.
    One or more topics the method should listen on.
  • Element Details

    • value

      @AliasFor("topic") String[] value
      One or more topics the method should listen on. If empty the default 'beanName.methodName' is used.
      Default:
      {}
    • topic

      @AliasFor("value") String[] topic
      One or more topics the method should listen on. If empty the default 'beanName.methodName' is used.
      Default:
      {}
    • match

      Specifies the match policy
      Default:
      EXACT