1 2 Previous Next 19 Replies Latest reply: Mar 23, 2013 7:36 PM by FabioDouek RSS

    How to pick messages from a queue after a specified time interval OSB 11g

    User554830
      We have designed asynchronous OSB services using JMS queues . Whenever there is a problem with target system we put those messages to some other queue (named error queue) .

      Could you please let me know how to send these error queue messages back to normal queue after a specified time interval (say 2 hours ) ?

      Please help .

      Regards,
      Neeraj
        • 1. Re: How to pick messages from a queue after a specified time interval OSB 11g
          FabioDouek
          Hi,

          The easiest way is to have a Proxy service listening from the error queue and set the JMSDeliveryTime to the absolute time of two hours ahead, putting back in the originating queue.
          You have to be careful to avoid some messages being in the loop forever....

          Regards,
          Fabio Douek
          • 2. Re: How to pick messages from a queue after a specified time interval OSB 11g
            FabioDouek
            Another way is to set for the error queue Queue -> Overrides -> "Time-to-Deliver Override". This is the delay in millis.
            Then have a proxy service consuming from the error queue and moving the message back to the normal queue.

            By doing that, the proxy will always be listening the queue, however it will not pickup the message until the delivery time is reached.

            Regards,
            Fabio Douek
            • 3. Re: How to pick messages from a queue after a specified time interval OSB 11g
              User554830
              Hi Fabio,

              Thanks for the quick reply of my query . When I was going through the definition of time to delivery parameter , I found the following definition

              "The default delay, either in milliseconds or as a schedule, between when a message is produced and when it is made visible on its target destination, regardless of the delivery time specified by the producer and/or connection factory."

              I can set time in milli seconds , that is ok and fine but can you please let me know how to set this schedule in this parameter ?

              I shall be highly thankful to you .

              Regards,
              Neeraj
              • 4. Re: How to pick messages from a queue after a specified time interval OSB 11g
                FabioDouek
                Hi Neeraj,

                If you take the approach of setting the override in the Error queue, you just specify the delay in milliseconds. The absolute time will be automatically calculated. There is no scheduling involved.
                Your other proxy service will be listening to the queue. Whenever the delay elapses, then the message will be "visible" to the proxy service and the message will be consumed.

                Regards,
                Fabio Douek
                • 5. Re: How to pick messages from a queue after a specified time interval OSB 11g
                  User554830
                  Hi Fabio,

                  Many thanks for solving my query .

                  I got answer for my second query on the following link :

                  http://docs.oracle.com/cd/E24329_01/web.1211/e24387/manage_apps.htm#JMSPG259


                  Regards,
                  Neeraj
                  • 6. Re: How to pick messages from a queue after a specified time interval OSB 11g
                    FabioDouek
                    Hi Neeraj,

                    Great. If you believe the question is answered, it should be marked as answered correctly :)
                    • 7. Re: How to pick messages from a queue after a specified time interval OSB 11g
                      User554830
                      Hi Fabio,

                      We also have one parameter Delivery Mode Override under overrides tab .

                      If I donot set this parameter as "PERSISTENT" will my message be lost without sending it back to error queue ?

                      This is currently happening in my scenario . I have not set this parameter and my message are lost without sending to error queue .

                      Please advice and let me know the use of this parameter(Delivery Mode Override) when I have already set the Delivery Failure tab parameters viz. Expiration policy -->Redirect and Error Destination--- > My error queue ?

                      I shall be thankful to you .

                      Regards,
                      Neeraj
                      • 8. Re: How to pick messages from a queue after a specified time interval OSB 11g
                        FabioDouek
                        Hi Neeraj,

                        No, the message should go to the error queue. If it's not persistent, it could be lost if the server is restarted, for example.
                        Were the messages being sent to the error queue before in case of a failure? Note that for that to happen, there are a couple of things to keep in mind, such as do not use the reply action in the pipeline and other QOS settings.

                        Regards,
                        Fabio Douek
                        • 9. Re: How to pick messages from a queue after a specified time interval OSB 11g
                          User554830
                          Hi Fabio,

                          The message is still showing me in the normal queue only . When I click the monitoring tab of jms queue , under messages pending i can see the message , it is not getting delivered to error queue .

                          Also in my proxy service error pipeline I have used the stage Raise error . Should I remove that to send messages to error queue ?

                          Regards,
                          Neeraj
                          • 10. Re: How to pick messages from a queue after a specified time interval OSB 11g
                            FabioDouek
                            Hi Neeraj,

                            It's correct to Raise Error.
                            Make sure that "Redelivery Limit" is not set to -1. Set to zero, just to make it easier to test, then you can change it later to meet your requirements.

                            An important question, so I can help you: Was the message being moved to the error queue before you make the config changes? What changes exactly did you make?
                            What is the usage in your pipeline? You consume from one queue and then do what?

                            Regards,
                            Fabio Douek
                            • 11. Re: How to pick messages from a queue after a specified time interval OSB 11g
                              User554830
                              Hi Fabio,

                              I am trying to send a message through jms queue and wants a reliable delivery , so i dont want the message to be lost if the target system is down .

                              In current scenario , when the message is coming to my normal queue and my target is down , the message is going into message pending state of the normal queue .

                              Even i had set the redelivery limit to 0 as suggested by you , the message is not going to error queue .

                              My configured parameters in delivery failure tab are :
                              Redirect with error destination as error queue .

                              I am not able to understand why is the message got stucked in nomal queue's pending messages even when redelivery limit is 0 ?

                              Please help.

                              Regards,
                              Neeraj
                              • 12. Re: How to pick messages from a queue after a specified time interval OSB 11g
                                User554830
                                Hi Fabio,

                                There are 16 consumers for the jms queue . So, is this the reason for messages to go in pending state unless all consumers will retry it will be in pending state ?

                                When everybody is done with their retries then it would go to error queue ?

                                Regards,
                                Neeraj
                                • 13. Re: How to pick messages from a queue after a specified time interval OSB 11g
                                  FabioDouek
                                  Hi Neeraj,

                                  16 is the default number of consumers if you don't specify a work manager. What you described is not correct. Only One consumer gets a message, and if it fails it rollback. If there is unlimited number of retries, then the message will go back to the queue, the proxy service will try again and if it fails this will go on forever.

                                  If you answer my questions in my previous message, it will make it easier to understand where we are.
                                  Have you already developed the other proxy service to put the message back in the normal queue?

                                  Regards,
                                  Fabio Douek
                                  • 14. Re: How to pick messages from a queue after a specified time interval OSB 11g
                                    User554830
                                    Hi Fabio,

                                    I have two proxy services . One proxy service is receiving message from a queue and sending it to target system .In case it fails I have second proxy service which is polling error queue and sending message back to normal queue via a business service (In biz service I have configured normal queue URL).

                                    But currently when my target system is not available the messages are going to normal queue's pending message list . They are no longer going to error queue even after waiting for a long time .

                                    The time I configured under delivery failure tab is as under :

                                    Redelivery limit =3
                                    Redelivery override=10000
                                    Expiration policy=redirect
                                    Error destination=error queue

                                    As per configurations the message should go to error queue after 3*10000 =30 seconds . But even after waiting for 10 minutes the messages were there in normal queue's pending list . They are not moving to error queue . Hence the error proxy cannot work and put the message back to normal queue .

                                    Please look into it and help why after 30 seconds messages dont move to error queue .


                                    Regards
                                    Neeraj
                                    1 2 Previous Next