5 Replies Latest reply on Aug 21, 2007 2:19 PM by kurtstam

    Storing a Message with a UUID of my Choosing

    jplenhart

      Hello,

      I have started storing my messages using the DBMessageStoreImpl

      I was planning on usine WS-Addressing for the message coming into the bus to determine where the message needs to be routed outside of the bus once the processing in the bus is completed.

      The processing could take seconds or days.

      I figured I would need to create a DBMessageStoreImpl that would store the replyTo out of my WS-Addressing headers into the message store, along with an id to reassociate the response message (response from a processing service) to what is in the database.


      Something like this:
      1) Message comes into the bus
      2) Message is stored with the return address of the sender and a trxn id
      3) Message is sent to a service that could take 3 seconds or 3 days

      Message is received from service in step 3 above

      4) Reassociate the message received via a trxn id (this trxn id is business specific)
      5) Get the reply address
      6) send it out the door back to the originating requestor

      If I created my own DBMessageStoreImpl would I be on the right track here or would there be a more streamlined approach for this?

      Thanks,

      Jason

        • 1. Re: Storing a Message with a UUID of my Choosing
          kurtstam

          I think it makes sense to be able to set your own UUID. I have another use case for that too. If that it all you need please open a feature request for it and assign it to me, I will simply add it to the current DBMessageStoreImpl. It will however throw an exception if the key is already in there. So it need to be a true UUID :).

          --Kurt

          • 2. Re: Storing a Message with a UUID of my Choosing
            kurtstam

            Or even better, send in a patch for it :).

            • 3. Re: Storing a Message with a UUID of my Choosing
              jplenhart

              Hi Kurt,

              Are you thinking of setting this as a parameter like 'classifiction' is set in the jboss-esb.xml?

              For my requirement I would have to do this at runtime - so I believe that perhaps there could be something in the message that could be set prior to calling the messagestore action - what do you think?

              Thanks,

              Jason

              • 4. Re: Storing a Message with a UUID of my Choosing
                jplenhart

                I am having an issue with the MessageStore and no error messages...

                <actions>
                 <action name="displayMessage"
                 class="org.jboss.soa.esb.actions.SystemPrintln">
                 <property name="message" value="XXXXXXXXXXX ABOUT TO INSERT TO MESSAGE STORE XXXXXXXXXXX" />
                 <property name="printfull" value="true" />
                 </action>
                
                
                
                <!-- Add a copy of the message to the message store under categorization 'test' -->
                 <action name="PersistAction" class="org.jboss.soa.esb.actions.MessagePersister" >
                 <property name="classfication" value="test"/>
                 <property name="message-store-class" value="org.jboss.internal.soa.esb.persistence.format.db.DBMessageStoreImpl"/>
                 </action>
                
                
                
                
                 <action name="displayMessage" class="org.jboss.soa.esb.actions.SystemPrintln">
                 <property name="message" value="XXXXXXXXXXX FILE PLACED IN DIRECTORY XXXXXXXXXXXX" />
                 <property name="printfull" value="true" />
                 </action>
                </actions>
                



                For some reason - I get the first SystemPrintln and the message is stored in the db - then I get no error and the second SystemPrintln does not happen.

                Any ideas?

                Thanks,

                Jason

                • 5. Re: Storing a Message with a UUID of my Choosing
                  kurtstam

                  1. You can set it at at runtime, with the code on the trunk, by setting a property on the message, like for example:

                  message.getProperties().setProperty(MessageStore.CLASSIFICATION, MessageStore.CLASSIFICATION_RDLVR



                  2. I have no idea why your second PrintLn would fail.

                  --Kurt