5 Replies Latest reply on Mar 15, 2019 2:55 PM by Tom B-Oracle

    Store and Forward(SAF) agents configuration not working

    MoinAhmed

      Hi All,

       

      I have configure a SAF agent between tow domains and facing an issue between them.SAF Configuration.PNG

       

      Below is my environment details.

       

      Platform         >     AIX 7.1

      OSM Version         >     7.3.5.0.0   

      Oracle WebLogic      >     12c 12.2.1.3.0

      Oracle Fusion Middleware >      12c 12.2.1.2.0

      Oracle DB         >     12.1.0

       

      Configuration Details:

       

      Two Domains configure on same machine:

       

      SOM Domain

      COM Domain

       

      Configuring a SAF (Store-and-forward) between COM To SOM domain:

       

       

      Source side Configuration details:

      =================================

       

      For both of the COM and SOM go to domain name >security from weblogic admin console. DONE

       

       

      COM:

      ====

         

      JMS Server:            XXXJMSServer

      JMS MOdel:            XXXJMSSystemModule

      Connection Faxtory:          OSMJMSCF

      Connection Faxtory JNDI Name:    jms/OSMJMSCF

      Queue:                TestLocalQueue

      JNDI Name:            jms/TestLocalQueue ==> COM to SOM

       

       

      Steps:

       

      SAFSource         10.254.XXX.XX:10001 ==> COM

      SAFDestination    10.254.XXX.XX:11001 ==> SOM

       

       

      1-     SAF Persistent JMS Store:

          - Name : TestFileStore

         

      2-    Create Remote SAF Context in the JMS Module

              - Name: TESTRemoteSAFContext

          - URL:  t3://10.254.172.94:11001 ==> SOM

       

      3-    SAF Error Handling:

          - TESTSAFErrorHandling

         

      4-    Create SAF Imported Destination in Jms Module.

               Name: TESTSAFImportedDestinations

           Prefix the JNDI name: TEST.

       

      Here is my Subdeployment details:

       

      - Name:        TestSubDeployment

      - Resources:   TESTSAFImportedDestinations

      - Target:      TESTSAFAgent

       

       

      5-     Queue in SAF Imported Destination

          - Queue Name:         TESTSAFQueue

              - Remote JNDI Name:   TestRemoteQ

              - Local JNDI Name:    TestLocalQueue

         

         

      6-    Create a Store and Forward Agent and have the agent type as Both. Target it to the Admin Server.

              - Name:             TESTSAFAgent

              - Scope:            Global

              - Persistent Store: TestFileStore

              - Agent Type:       'Sending-only'

       

       

       

      SAF Configuration:

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

         

      SOM:

      ====

       

      Target side Configurations:

      ===========================

       

      JMS Server:            TESTJMSServer

      JMS MOdel:            TestJMSModule

      Source side subdeployment:      TESTSubDeployment

      Connection Factory Name:        jms/TESTConnectionFactory

      Connection Faxtory JNDI Name:    jms/TESTConnectionFactory

      Queue:                TestRemoteQ

      JNDI Name:            jms/TestRemoteQ ==> COM to SOM

       

       

      Problem:

       

      I am inserting the massage in COM local queue [b]'TestLocalQueue'[/b] which is map with my SAF agent. but the the massage stuck in the Queue and not transferring the Remote Queue [b]'TestRemoteQ'

      [/b], anybody have an idea what wrong with my configuration why the massage is transferring.

       

      I hope you people understand my problem in the above detail description.

       

       

      Regard

        • 1. Re: Store and Forward(SAF) agents configuration not working
          Tom B-Oracle

          I advise:

          - First get SAF to work intra-domain on 12.2.1.3 (the simplest case).

          - Then get it to work cross-domain where both are at 12.2.1.3 versions.

          - Finally get it to work in your particular use case...

           

          Some common things to check:

          - Check your WL log files for SAF info, warnings, and errors - especially on the source side.

          - Make sure your two domains have different names.

          - Make sure you've setup cross domain security https://docs.oracle.com/cd/E13222_01/wls/docs103/secmanage/domain.html

          - There are a variety known issues with 12.2.1.2 - including communication issues IIRC - so simply updating your 12.2.1.2 domain to 12.2.13 might help.

           

          Hope this helps!

          Tom

          • 2. Re: Store and Forward(SAF) agents configuration not working
            MoinAhmed

            Thanks Tom for the reply.

             

            1- Both the domains are in the same machine with the same weblogic version, and both domains have different name.

            2- Cross-domain is enable between both domains and its properly working.

            3- I have create internal bridge between both domains and its working, massages are transfer from both sides.

             

            I have follow the below link to configure a SAFAgent.

             

            https://community.oracle.com/people/Bhaswati+Chatterjee/blog/2016/06/03/implementing-store-and-forwardsaf-agents-soa-11g…

             

            I have used a Java Class to send a message to test the SAF with this code:

             

            import java.util.Hashtable;

            import javax.jms.Connection;

            import javax.jms.JMSException;

            import javax.jms.MessageProducer;

            import javax.jms.Queue;

            import javax.jms.QueueConnectionFactory;

            import javax.jms.Session;

            import javax.jms.TextMessage;

            import javax.naming.Context;

            import javax.naming.InitialContext;

            import javax.naming.NamingException;

             

            public class TestSAF {

                    public static void main(String[] args) {

                            String CFName = "jms/OSMJMSCF";

                            String destName = "TEST.jms.TestLocalQueue";

             

                            Connection conn = null;

                            Session session = null;

                            MessageProducer prod = null;

                            try {

                                    // Set the Initial Context properties

                                    Hashtable env = new Hashtable();

                                    env.put(Context.SECURITY_PRINCIPAL, "weblogic");

                                    env.put(Context.SECURITY_CREDENTIALS, "ptcl1234");

                                    env.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");

                                    env.put(Context.PROVIDER_URL, "t3://10.254.172.94:10001");

             

                                    InitialContext context = new InitialContext(env);

             

                                    // Lookup connection factory

                                    QueueConnectionFactory queueConnectionFactory = (QueueConnectionFactory) context.lookup(CFName);

             

                                    // Create a connection and session

                                    conn = queueConnectionFactory.createConnection();

                                    session = conn.createSession(false, 0);

             

                                    // Lookup queue

                                    Queue q = (Queue) context.lookup(destName);

             

                                    // Send message

                                    prod = session.createProducer(q);

                                    TextMessage msg = session.createTextMessage();

                                    msg.setJMSMessageID(String.valueOf(System.currentTimeMillis()));

                                    msg.setText("Moin TEST MESSAGE with new Local JNDI name");

                                    prod.send(msg);

             

                            } catch (NamingException ne) {

                                    System.out.println("NamingException: " + ne.toString());

                            } catch (JMSException jmse) {

                                    System.out.println("NamingException: " + jmse.toString());

                            } finally {

                                    try {

                                            prod.close();

                                            session.close();

                                            conn.close();

                                    } catch (Exception e) {

                                            System.out.println("Excepion in finally branch: " + e.toString());

                                    }

                            }

                    }

            }

             

            After compiling an executing the Java class, the message reached Domain2.

             

             

            when I am inserting a massage in domain1 local queue 'TestLocalQueue' which is map with my SAFAgent, massage is stuck in the Queue  and not transferring to the  Domain2 Remote Queue 'TestRemoteQ'.

             

            Regards,

            Moin

            • 3. Re: Store and Forward(SAF) agents configuration not working
              Tom B-Oracle

              - Check your WebLogic log files for SAF info, warnings, and errors - especially on the source (SAF Agent forwarder) side.   (Check the actual log files - DOMAIN_HOME/servers/wl-server-name/logs by default - not the stdout capture.)

               

              - If you are using 12.2.1.0/1/or 2:  There are a variety known issues - including communication issues IIRC - so simply updating your  domain to 12.2.13 might help.

              • 4. Re: Store and Forward(SAF) agents configuration not working
                MoinAhmed

                Hi Tom,

                 

                as I describe in my previous thread that I have configured the SAF in my environment and I wanted to send a massage from local to remote destination using with the SAF agent service.

                Do you have any idea how to send a massage to remote destination domain with with or without using the java code.

                 

                 

                Regards

                Moin Ahmed

                • 5. Re: Store and Forward(SAF) agents configuration not working
                  Tom B-Oracle

                  To summarize the finding so far:

                   

                  - You are trying to get SAF Agents to work between two domains in order to forward messages from an imported destination in a 'start' domain to a distributed destination in a 'remote' domain.

                  - The test successfully sent a message directly to the remote queue.

                  - The test successfully sent a message to a local imported queue for a local SAF Agent, but this message is 'stuck' in the local imported queue and is not getting forwarded by the SAF Agent to the remote queue.  

                  - You have verified that 'cross domain security' is configured.

                  - You have verified that using a message bridge as an alternative to SAF works.

                  - You have verified that that the two domains have different domain names.

                   

                  This is why I now recommend:

                   

                  - Have you tried getting SAF to work 'intra-domain'?  This helps eliminate 'cross domain' as the issue.

                  - Check the logs of the WL Servers that host the SAF Agent that hosts the imported destination where the message is stuck.

                  - Try using 12.2.1.3 if you're using an older version (just to eliminate version as a factor).

                   

                  If you're looking for alternatives to SAF:

                   

                  - Messaging Bridge (as you've already successfully tried)

                  - Write a very simple MDB deployed to the remote side that consumes from the 'start' Distributed Q and enqueues to the 'end' Q (or an MDB deployed on the local side that forwards messages).   Unlike Bridges, MDBs automatically and transparently consume from all members of a DQ.

                   

                  I personally tend to recommend using MDBs.  A potential concern with MDBs is that, like Message Bridges, these must use cross-domain JTA transactions to achieve exactly-once messaging -- and JTA cross-domain can get tricky if there's a firewall/load-balancer on the network between the domains.

                   

                  HTH,

                  Tom