how to configure saf agent to forward to a distributed destination

12
HOW TO CONFIGURE, TEST, MONITOR AND DEBUG THE SAF AGENT WHEN FORWARDING TO A DISTRIBUTED DESTINATION This is a guide to set up an example SAF setup. It requires that you configure two domains. In this example, the domain where the SAF Agent is deployed is referred to as the FE domain and the domain containing the distributed destination where messages are forwarded to as the BE domain. Remember that unique names must be used for all JMS related components. Both domains contain two managed servers. BE Domain Configuration 1) To begin with, create a file store on each migratable target. Strictly speaking there is a default persistence store that is created by default on each managed server, but in setting up and testing most environments won’t rely on this. 2) For each Managed Server you will need to configure a JMS server using the file Store.

Upload: ravi-bhardwaj

Post on 23-Feb-2015

77 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: How to Configure SAF Agent to Forward to a Distributed Destination

HOW TO CONFIGURE, TEST, MONITOR AND DEBUG THE SAF AGENT WHEN FORWARDING TO A DISTRIBUTED DESTINATION This is a guide to set up an example SAF setup. It requires that you configure two domains. In this example, the domain where the SAF Agent is deployed is referred to as the FE domain and the domain containing the distributed destination where messages are forwarded to as the BE domain. Remember that unique names must be used for all JMS related components. Both domains contain two managed servers. BE Domain Configuration 1) To begin with, create a file store on each migratable target. Strictly speaking there is a default persistence store that is created by default on each managed server, but in setting up and testing most environments won’t rely on this.

2) For each Managed Server you will need to configure a JMS server using the file Store.

Page 2: How to Configure SAF Agent to Forward to a Distributed Destination

Eventually you’ll end up with a JMS server created on both migratable targets.

3) Then you will need to add and target a JMS Module, giving it a meaningful name.

Page 3: How to Configure SAF Agent to Forward to a Distributed Destination

And deploy it to the cluster

For Ease, select the option that will allow you to immediately add JMS deployments to the Module. 4) Within the JMS Module configure a SubDeployment. The SubDeployment points to the JMS Servers and not the Managed Servers. Always use SubDeployment for JMS deployment purposes, the default targetting is prone to errors and confusion with anything other than Connection Factories and simple JMS destinations.

Page 4: How to Configure SAF Agent to Forward to a Distributed Destination

5) Within the JMS Module, configure a Distributed Destination and Target to the SubDeployment.

Page 5: How to Configure SAF Agent to Forward to a Distributed Destination

It is important to use the targeting option correctly and target to the subdeployment. You have been warned!

Page 6: How to Configure SAF Agent to Forward to a Distributed Destination

6) Within the JMS Module, create a new resource and select a Connection Factory. For this you can rely on the default targeting, so after naming the resource, simply select finish and allow it to be targeted to the cluster. If you want to (at this point) you can test the Distributed Destination using the clients that are given later in this document, just point the QueueMultiSend client to the URL for the distributed destination. FE Domain Configuration This is where we configure the SAF components. To allow connection to these locally (for testing), we need to also configure a JMS Connection Factory. For this example I’ve targeted to the Migratable Target as the best practice is to use Migratable Target for SAF Agent deployment. 1) Create a file store and target to each Migratable Target that will have a SAF agent on it. This is identical to step 1 in the BE Domain Configuration. 2) Create a SAF Agent for each Migratable Target, so that each managed server will have a SAF Agent.

Page 7: How to Configure SAF Agent to Forward to a Distributed Destination

3) Now create a new JMS module. This is identical to step 3 in the BEDomain configuration. 4) To correctly target the SAF Components, create a Sub Deployment that allows you target the SAF Imported Destination (created later) to the SAF Agents, paying attention to where you are targeting it.

Page 8: How to Configure SAF Agent to Forward to a Distributed Destination

5) To give the details of the remote servers, you need to configure a Remote SAF Context within the JMS Module. This is the component that tells the SAF Agent where the domain containing the JMS destination is for the messages to be forwarded to, so it contains the details of the BE Domain. To do this, you need to go to the Module, select “New” resource. When presented with the list of resources, select Remote SAF Context.

6) Now you need to create the SAF Error Handling using the Distributed Destination from the FE domain. To do this, you need to go to the Module, select “New” resource. When presented with the list of resources, select SAF Error Handling.

7) Here is where you create the SAF Imported Destination. You use the SAF Remote Context and SAF Error Destination that you have already created.

Page 9: How to Configure SAF Agent to Forward to a Distributed Destination

Then target using the subdeployment, so ensure you use the Advanced Targeting option.

6) Now add the Distributed Destinations that are hosted by the BE Domain within the SAF Imported Destination. Open the SAF Imported Destination, select the Queue tab.

Page 10: How to Configure SAF Agent to Forward to a Distributed Destination

7) Finally, for testing purposes, we need to create a JMS Connection Factory on the FE Domain side. Testing Below are two JMS clients (embedded into the document) that can be used for testing. In honesty, they are simply altered versions of the JMS example clients that ship with WLS.

QueueMultiSend.java QueueReceive.java

For the multi send client the usage is simply java QueueMultiSend WebLogicURL ConnectionFactory Queue MessageTimes SleepPeriod To send messages you need to specify the cluster or the address of one of the FE Domain Managed Servers, The FEDomain ConnectionFactory and the SAF Queue name. This last one is the tricky one, it means that you need you specify the BE Distributed Destination

Page 11: How to Configure SAF Agent to Forward to a Distributed Destination

prefixed by the SAF prefix. In the example that I’ve done here the full JNDI would be FESAFImpDestBEDistributedQueue For the receive client, the syntax is simply java QueueMultiSend WebLogicURL ConnectionFactory Queue If you want to guarantee where the consumers are Debugging Options There are debugging options for SAF given in the documentation. To be honest, they are quite specialized and unless there is a specific issue that demands them, not very useful. For general use, the DebugJMSSAF (scope weblogic.jms.saf) option is enough. However for tracking message ID’s, the JMS debug is also useful, and investigating SAF issue, the verbose options of DebugMessagingKernel DebugJMSBackEnd DebugJMSCDS JMS Message Monitoring One of the most useful features of JMS is the message monitoring through the jms.message.logs. This shows when a message is publish to a queue, consumed from a queue and deleted from a queue, and it also shows if a message is stored and forwarded from the SAF agent. The log file location and rotation method is defined on the SAF-Agent under the JMS Logging tab, but to enable the logging you need you need to access the SAF import destination in the JMS module.

Then you can set the logging options for the destination on the Logging tab.

Page 12: How to Configure SAF Agent to Forward to a Distributed Destination

On the physical destination, the JMS log file location and rotation method are set by the JMS server, under the Logging tab, but for messaging to be enabled on the distributed destination you need to open the Destination and select the Queue. With SAF you can log the body of the message, but with the destination you can’t.