6 Replies Latest reply on Nov 7, 2008 2:34 AM by wili

    MessagePersister and Message Redelivery problem

    wili

      For days I simply try to set the destination of a message, persist it to the RDLVR-queue and let the MessageRedeliverer deliver it to the specified destination.

      I read http://www.jboss.com/index.html?module=bb&op=viewtopic&t=116023&postdays=0&postorder=asc&start=10,
      http://www.jboss.com/index.html?module=bb&op=viewtopic&t=117000 and the docu.

      I modified the simplest helloworld-example:

      ESBMessageSender (faultTo can only be set by a sender.. so I did! ):

      Message esbMessage = MessageFactory.getInstance().getMessage();
       final LogicalEPR logicalEpr = new LogicalEPR("fault","faultToService");
       esbMessage.getHeader().getCall().setFaultTo(logicalEpr); // affects nothing !
       esbMessage.getHeader().getCall().setReplyTo(logicalEpr); // my stupid attempt ;-)
       esbMessage.getBody().add("body");
      
       final ServiceInvoker si = new ServiceInvoker("FirstServiceESB", "SimpleListener");
       si.deliverAsync(esbMessage);


      <services>
       <service category="FirstServiceESB" name="SimpleListener"
       description="Hello World">
       <listeners>
       <jms-listener name="JMS-Gateway" busidref="quickstartGwChannel"
       is-gateway="true" />
       <jms-listener name="helloWorld" busidref="quickstartEsbChannel" />
       </listeners>
      
       <actions mep="OneWay">
       <action name="persist"
       class="org.jboss.soa.esb.samples.quickstart.helloworld.PersistAction"/>
      
       <action name="PersistAction" class="org.jboss.soa.esb.actions.MessagePersister">
       <property name="classification" value="RDLVR" />
       <property name="message-store-class"
       value="org.jboss.internal.soa.esb.persistence.format.db.DBMessageStoreImpl" />
       </action>
       </actions>
       </service>
      
       <service name="faultToService" category="fault" invmScope="GLOBAL" description="print a testmessage">
       <actions mep="OneWay">
       <action name="action1" class="org.jboss.soa.esb.actions.SystemPrintln">
       <property name="message" value="############# FAULTSERVICE" />
       </action>
       </actions>
       </service>
       </services>
      



      23:20:21,915 WARN [ActionProcessingPipeline] Unexpected exception caught while processing the action pipeline: header: [ ]
      java.lang.NullPointerException
       at org.jboss.internal.soa.esb.persistence.format.db.DBMessageStoreImpl.redeliver(DBMessageStoreImpl.java:392)
      23:20:21,915 WARN [ActionProcessingPipeline] No fault address defined for fault message!
      
      


      No matter if I use synchronous or asynchronous invoking, the message is stored to DLQ.

        • 1. Re: MessagePersister and Message Redelivery problem
          beve

          Hi,

          the post http://www.jboss.com/index.html?module=bb&op=viewtopic&t=116023&postdays=0&postorder=asc&start=10 , is outdated and this was a temporary solution for the project we were working on.
          We later removed this and used jms to handle persistence and redelivery. The code changes mentioned in that post were never added to the code base.
          The jms_transacted quickstart is similar to the solution that we later used to handle redelivery.

          Regards,

          /Daniel

          • 2. Re: MessagePersister and Message Redelivery problem
            wili

            Hmpf ok.

            In the meantime I understood, how to set the To-property:

            Service service = new Service("fault", "faultToService");
            message.getProperties().setProperty(ServiceInvoker.DELIVER_TO, service);


            Pretty easy. but it took me a long time :(

            • 3. Re: MessagePersister and Message Redelivery problem
              beve

               

              Hmpf ok.

              Not sure what you are trying to say here.
              I'll guess that you were confused by reading the thread about the message persister/redeliver in the design forum?
              So I've updated that thread to make it clear that it is outdated:
              http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4187176#4187176

              /Daniel

              • 4. Re: MessagePersister and Message Redelivery problem
                wili

                I'am still a bit confused although there is a lot about failures and message loss in the docu:


                Once a message is accepted by a Gateway it will not be lost unless sent within the ESB using an unreliable transport. All of the following JBossESB transports can be configured to either reliably deliver the Message or ensure it is not removed from the system: JMS, FTP, SQL.
                (.....)
                Within JBossESB, the only transport you can use which gives the above mentioned failure semantics on Message delivery and processing is JMS: with transacted sessions , it is possible to guarantee that Messages are received and processed in the presence of failures. If a failure occurs during processing by the service, the Message will be placed back on to the JMS queue for later re-processing.


                I use "normal" JMS-Queues between the different ESB-Services. Does the JBoss-Message Provider persist all messages so that that they are delivered after e.g. JBossEsb is up again after a failure?
                Are these messages still available after a JMS-Broker failure?

                My big question: How can I (nearly) guarantee that Messages are delivered after they entered through a Gateway-Listener?

                • 5. Re: MessagePersister and Message Redelivery problem
                  beve

                   

                  Does the JBoss-Message Provider persist all messages so that that they are delivered after e.g. JBossEsb is up again after a failure?

                  Yes, by default messages will be persisted by the JMS-Broker. This is configurable.


                  How can I (nearly) guarantee that Messages are delivered after they entered through a Gateway-Listener?

                  After a client has posted a message to a gateway destination you can be sure that that message will not be lost.
                  If you specify that your listener is transacted then if an error occurs in the action pipeline the transaction will be rolled back and the message will be placed back onto the queue.

                  Regards,

                  /Daniel

                  • 6. Re: MessagePersister and Message Redelivery problem
                    wili

                    Thank you beve!! It took a load off my mind. =)