Uploaded image for project: 'HornetQ'
  1. HornetQ
  2. HORNETQ-381

Support temporary destinations in Stomp implementation

    Details

      Description

      It would be great if HornetQ could also expose JMS temporary destinations.

      With the standard Stomp protocol, there is no way for the client to specify that a queue is a temporary queue, or to get the temporary queue name. For this reason, in OpenMQ and ActiveMQ implementations of Stomp, special queue name prefixes are used to indicate a temporary queue, for example "/temp-queue/" prefix denotes a TemporaryQueue (with name follows the prefix) in OpenMQ, and "temporary_destination://queue/" must be used to send reply messages to a MESSAGE frame's reply-to destination.

      Here is an example for a request-reply communication between two Stomp clients iin ActiveMQ:

      app 1 ("client") sends:
      SEND
      destination:/queue/client.messages <------ client sends to a normal queue
      reply-to:/temp-queue/0 <------- but uses special /temp-queue/ prefix in the reply-to address

      request

      app 2 ("server") receives:
      MESSAGE
      message-id:ID:mj-PC-50081-1272908928369-3:10:-1:1:1
      destination:/queue/client.messages <------- incoming message on normal queue
      timestamp:1272908931851
      expires:0
      subscription:

      {76652F18-856D-42A0-8637-6F87CC6320D8}

      priority:0
      reply-to:/remote-temp-queue/ID:mj-PC-50081-1272908928369-3:10:1 <----- temp queue reply-to assigned by broker

      request

      app 2 ("server") sends:
      SEND
      destination:/remote-temp-queue/ID:mj-PC-50081-1272908928369-3:10:1 <---- reply to temp queue

      reply

      app 1 ("client") receives:
      MESSAGE
      message-id:ID:mj-PC-50081-1272908928369-3:9:-1:1:1
      destination:/remote-temp-queue/ID:mj-PC-50081-1272908928369-3:10:1 <---- received from temp queue
      timestamp:1272908931859
      expires:0
      subscription:

      {CB137D70-ACA6-4CB4-AF7E-0D01CBC3C2A0}

      priority:0

      reply

      -------------
      Here is the same example with Open Message Queue (OpenMQ):

      client send:
      SEND
      destination:/queue/serverqueue
      reply-to:/temp-queue/0
      messagetype:text

      request

      server received:
      MESSAGE
      subscription:

      {42882213-93A0-442F-963A-56F7E3F657A3}

      destination:/queue/serverqueue
      reply-to:/temp-queue/temporary_destination://queue/client/54013/1
      message-id:ID:57-192.168.178.24(e3:7:bb:91:96:a0)-54013-1272980252968
      expires:0
      redelivered:false
      priority:4
      timestamp:1272980252968
      messagetype:text
      content-length:7

      request

      server send:
      SEND
      destination:/temp-queue/temporary_destination://queue/client/54013/1
      messagetype:text

      response

      client received:
      MESSAGE
      subscription:

      {506AF843-8794-40AE-911B-198798E47C98}

      destination:/temp-queue/temporary_destination://queue/client/54013/1
      message-id:ID:65-192.168.178.24(a3:e:6d:f1:f2:64)-54015-1272980253006
      expires:0
      redelivered:false
      priority:4
      timestamp:1272980253006
      messagetype:text
      content-length:8

      response

      Implementation note: this client uses a simple integer sequence to create unique queue names, the "reply-to:/temp-queue/0" is the first generated queue name for this connection.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                clebert.suconic Clebert Suconic
                Reporter:
                mjustin Michael Justin
              • Votes:
                4 Vote for this issue
                Watchers:
                7 Start watching this issue

                Dates

                • Created:
                  Updated: