1 Reply Latest reply: May 27, 2014 10:04 AM by Todd Little-Oracle RSS

    How to forward a local queue to a queue on a remote domain through configuration?

    user10661923

      We have an environment where we are breaking our application into 2 domains (1 SHM and 1 MP) from current single domain.

      These domains can work independently with the exception of /Q messages which we need to enqueue from the SHM domain but persist in the MP domain.

       

      We have a short term solution of remotely enqueues, which is to simply import the remote queuespace in our domain config file as below:

      *DM_REMOTE_SERVICES

      QSPCQRouterM                       

                     RACCESSPOINT=UAT4                       

                     LACCESSPOINT=FE_SHM_5201                       

                     RNAME="QSPCQRouterM"

       

      This shows in tmadmin as below:

      Service Name Routine Name Prog Name  Grp Name  ID    Machine  # Done Status

      ------------ ------------ ---------  --------  --    -------  ------ ------

      QSPCQRouterM GWS          GWTDOMAIN  GWGrp    152    TUX_MST      0 AVAIL

       

      While this works in the typical use case, but not when the remote domain goes down. For that scenario we need to have a local queue which we can forward to the remote domain when it comes up. We were hoping to implement this purely by configuration on the local domain by e.g. manipulating queue names and domconfig entries to alias the local queue to the remote queue, but have not been able to succeed.

       

      METHOD 1 – having identical queue spaces locally and remotely

       

      ubb       

           TMQUEUE               

                SRVGRP  = MQSGrpQRouterM               

                SRVID  = 1               

                MIN    = 4               

                MAX    = 10               

                CLOPT  = "-s QSPCQRouterM:TMQUEUE -- "       

           TMQFORWARD               

                SRVGRP  = MQSGrpQRouterM               

                SRVID  = 20               

                CLOPT  = " -- -qQRouterM,QRouter1M,QRouter2M,QRouter3M,QRouter4M"

      domconfig

               *DM_REMOTE_SERVICES

                QSPCQRouterM                       

                     RACCESSPOINT=UAT4                       

                     LACCESSPOINT=FE_SHM_5201                       

                     RNAME="QSPCQRouterM"

       

      This appeared to work initially in that the initial message was enqueued successfully to the remote side, but any other entries within a 60 second time period failed (i.e. if you waited 60 seconds before 2nd enqueue it would work). Modifying BLOCKTIME appeared to change the 60 second interval but the basic problem persisted. The challenge here appears to be “how does Tuxedo distinguish between local  QSPCQRouterM TMQUEUE and the remote QSPCQRouterM service.

       

      METHOD 2 – having a queue name routed to the QSPCQRouterM service from new queue space

       

      ubb       

           TMQUEUE               

                SRVGRP  = MQSGrpQRouterM               

                SRVID  = 1               

                MIN    = 4               

                MAX    = 10               

                CLOPT  = "-s QSPCFEQRouterM:TMQUEUE -- "       

           TMQFORWARD               

                SRVGRP  = MQSGrpQRouterM               

                SRVID  = 20               

                CLOPT  = " -- -qQSPCQRouterM "

      domconfig

           *DM_REMOTE_SERVICES

           QSPCQRouterM                       

                RACCESSPOINT=UAT4                       

                LACCESSPOINT=FE_SHM_5201                       

                RNAME="QSPCQRouterM"

       

      The message hung in the source queue space in this test

       

      METHOD 3 – having a local queue name routed to a remote enqueue service

      ubb      

           TMQUEUE               

                SRVGRP  = MQSGrpQRouterM               

                SRVID  = 1               

                MIN    = 4               

                MAX    = 10               

                CLOPT  = "-s QSPCFEQRouterM:TMQUEUE -- "       

           TMQFORWARD               

                SRVGRP  = MQSGrpQRouterM               

                SRVID  = 20               

                CLOPT  = " -- -qQRouterM "

      domconfig

           *DM_REMOTE_SERVICES

           QRouterM                       

                RACCESSPOINT=UAT4                       

                LACCESSPOINT=FE_SHM_5201                       

                RNAME="enqueueSvc"

       

      This didn’t work (went to error queue on queue space) but it looked like TMQFORWARD did retry (up to 100 times) as below:

      QRouterM    GWS          GWTDOMAIN  GWGrp    152    TUX_MST    202 AVAIL

       

      The challenge here is that our local “enqueueSvc” resides both locally and remotely. Also we don’t believe RNAME aliases in the way we would like it to.

       

      METHOD 4 (coded solution)

       

      We create a modification of our remote enqueue/dequeue service which advertises a new service remoteEnqueueSvc and we also set that up as the source queue name for TMQFORWARD.

      ubb      

           TMQUEUE               

                SRVGRP  = MQSGrpQRouterM               

                SRVID  = 1               

                MIN    = 4               

                MAX    = 10               

                CLOPT  = "-s QSPCQRouterM:TMQUEUE -- "       

           TMQFORWARD               

                SRVGRP  = MQSGrpQRouterM               

                SRVID  = 20               

                CLOPT  = " -- -qremoteEnqueueSvc"

      domconfig     

           *DM_REMOTE_SERVICES

           remoteEnqueueSvc                       

                RACCESSPOINT=UAT4                       

                LACCESSPOINT=FE_SHM_5201                       

                RNAME="remoteEnqueueSvc"

       

      We are currently building and testing this solution, but would be very interested to know if we could have done this with pure configuration. Any insights would be gratefully appreciated.

        • 1. Re: How to forward a local queue to a queue on a remote domain through configuration?
          Todd Little-Oracle

          Hi,

           

          First of all WOW.  You have certainly tried more alternatives than I think I could have come up with.  Unfortunately Tuxedo /Q doesn't support what you are trying to do.  Tuxedo Message Queue, an add on product that combines the best of Tuxedo /Q and Oracle MessageQ does support queue forwarding by configuration only.  Other than that, your only option is to create your own forwarder that takes messages from the local queue and enqueues them to the remote queue.  Using TMQFORWARD is not likely to work in almost all scenarios as the service request made as a part of tpenqueue/tpdequeue is not a "normal" service request.  So trying to forward to the queue space name isn't going to work.  You would have to actually tpdequeue from the local queue and then tpenqueue to the remote queue, preferably as part of a transaction to avoid any possible message duplication.

           

          Regards,

          Todd Little

          Oracle Tuxedo Chief Architect