subscribeJson method

void subscribeJson (String id, String destination, void onMessage(Map<String, String> headers, dynamic message), { Ack ack: AUTO, String receipt, Matcher matcher: exact, Map extraHeaders })

Subscribes for listening a given destination; assuming the message

  • are a JSON object.
  • stomp.subscribe("/foo", (message) {
    
  •   //handle message (it is a JSON object decoded from a JSON string)
    
  • });
    
    • id - specifies the id of the subscription. It must be unique
  • for each StompClient (until unsubscribe is called).
    • destination - specifies the destination to subscribe.
    • matcher - matches destination with the message's destination.
  • If omitted, exact is assumed.
    • extraHeaders - additional headers to be sent while subscribing.
  • If you'd like to specify a regular expression in destination,
  • you can use regExp. For GLOB pattern, use glob.
  • If you'd like to ignore the destination, use all.

Implementation

void subscribeJson(String id, String destination,
    void onMessage(Map<String, String> headers, message),
    {Ack ack: AUTO,
    String receipt,
    Matcher matcher: exact,
    Map extraHeaders});