Show TOC Start of Content Area

Procedure documentation Using JMS Store-and-Forward  Locate the document in its SAP Library structure

Use

JMS Store-and-Forward (SAF) enables independent AS Java clusters to deliver messages reliably between applications that are distributed across two clusters. The Java Server will take into account network disruption and system failure when delivering the messages. This means that you can store the messages locally and forward them when the remote destination is available.

The local resources defined in the application and the respective SAF Agent, which will deliver the messages are created on the Local Cluster upon deploy. The SAF Agent is the active part of the whole setup. It runs on the Local Cluster and attempts to deliver any messages received on the local destination to the remote destination defined in the deployed application.

·        Messages that are successfully delivered to the destination on the Remote Cluster are removed from the destination on the Local Cluster.

·        If there are network problems detected, the SAF Agent tries several times to deliver the messages to the Remote Cluster. You can set the maximum number of attempts using the property maxDeliveryAttempts in the jms-resources.xml file.

Note

If the Remote Cluster is an SAP Application Server, the uniqueness of the received messages is guaranteed. In this case, the receiving side checks if a message produced by a SAF agent is a duplicate. If the message is a duplicate, it is discarded.

      If the network is unavailable permanently, the maximum number of attempts will eventually be reached and the messages will be stored in an error destination on the Local Cluster. No further delivery attempts will be made.

Caution

Make sure that the status of the life cycle strategy of the deploy controller is not disable (in Telnet) or Sequential state dependent (in the Developer Studio), otherwise the SAF Agent will not be started when you update your application. You can check the current status of the deploy tool life cycle strategy using:

¡        Telnet

> deploy lifecycle=bulk

       SAP NetWeaver Developer Studio

More information: Deploying Archives

If the status of the life cycle strategy is disable or Sequential state dependent, change it to Bulk.

 

Note

Unlike other JMS resources, for example connection factories and destinations, SAF Agents can be deployed only from within application archives, and cannot be deployed from AS Java services.

This graphic is explained in the accompanying text

Procedure

Creating a New JMS SAF Agent Using the jms-resources.xml

To create a JMS SAF Agent, you have to make the following settings to the jms-resources.xml deployment descriptor:

      <name> - use this tag to specify the name of the SAF Agent. This name has to unique in the jms-resources.xml file.

      <factory-name-ref> under the <local-info> tag – use this tag to specify the connection factory to which the messages will be sent and from which the SAF Agent will consume messages before trying to send them to the remote destination.

       <destination-name-ref> under the <local-info> tag – use this tag to specify the destination to which the messages will be sent and from which the SAF Agent will consume messages before trying to send them to the remote destination.

      <destination-name-ref> under the <remote-info> tag – use this tag to specify the destination to which the message will be forwarded.

Note

The connection factory is deduced by the destination.

      <message-selector> - use this tag if you want to specify a message selector. The SAF Agent sends the messages that correspond to the message selector to the remote destination. If you do not want to use message selectors, leave this tag empty. In this way the SAF Agent sends all the messages from the local to the remote destination.

...

   <saf-agent>

      <name>new_saf_agent</name>

      <local-info>

         <factory-name-ref>local_factory</factory-name-ref>

         <destination-name-ref>

            local_destination

         </destination-name-ref>

      </local-info>

      <remote-info>

         <destination-name-ref>

            remote_destination

         </destination-name-ref>

      </remote-info>

      <message-selector></message-selector>

   </saf-agent>

Creating a New JMS SAF Agent Using the SAP NetWeaver Administrator

You can create a new JMS SAF Agent using the SAP NetWeaver Administrator.

More information: Creating JMS SAF Agent References

End of Content Area