Powered By Blogger

Wednesday, March 23, 2011

Configuring SAF JMS Resources

store and forward agents (SAF) in WLS is a mechanism by which WLS local JMS producers produces messages to remote JMS destinations. These remote JMS destination can be part of  other domain/machine/cluster.

Main steps involved are
  1. Create SAF agent
  2. Create SAF remote context
  3. Create SAF imported destination
  4. Configuring SAF  imported destination with remote Queues and Topics
 Create SAF agent
SAF agent is a component which  is responsible for storing and forwarding messages between local sending and remote receiving destinations
It stores messages locally when remote destination is not reachable and forwards it when remote destination is available.
We are trying to produce JMS messages to remote destination ; hence it is required
Provide appropriate values when creating SAF agent and make sure you select 'Sending Only' for agent type field.

Create SAF remote context
 SAF remote context holds connecting url and credential information to connect to remote WLS instance.
  1. Login to WLS console and navigate to Services> Messaging>JMS Modules, click on required JMS module<SOAJMSModule> on which you want to create this resource
  2. Click New button and select 'Remote SAF Context', click Next
  3. Specify required information and click OK
Note: URL format can be :// host:port, for example http://server1:8001

Create SAF imported destination

SAF imported destinations are collections of SAF queues and topics that locally represent JMS queues or topics on a remote server instance or cluster
  1. Login to WLS console and navigate to Services> Messaging>JMS Modules, click on required JMS module<SOAJMSModule> on which you want to create this resource
  2. Click New button and select 'SAF Imported Destination', click Next
  3. Provide any valid JNDI prefix, example safjms. and select remote SAF context created in previous step,click next
  4. Click Advanced Targeting and select one of subdeployments from list and make sure this resource is targeted to SAF agent created in 1st step.(To understand what we are doing here you need to understand JMS sub deployment mechanism in WLS)
  5. Click Finish
Configuring SAF  imported destination with remote Queue and Topics

 Now we have to associate remote JMS destinations with SAF imported destinations
  1. Click on created SAF imported destination
  2. Click on either Queues or Topics tab depending on type of resource you would like to access remotely
  3. Provide Remote JNDI name(This should exactly match the remote JMS destination JNDI) and click OK
  4. Now click on newly created resource and provide any valid local JNDI name for example saf.localjndi and click Save
Now you are ready to produce  messages to remote JMS destinations using local JMS producers

Note: Please use local JNDI prefix + local JNDI name to produce messages locally, in our case it becomes  safjms.saf.localjndi. To consume messages consumer has to use remote JNDI.





1 comment:

  1. I have few queries on SAF configuration,I have two domains at my end.
    1>Do i need to create SAF JMS Resources in both the domains?
    2>While creating remote SAF context do i need to specify the url of remote managed server?
    3>While configuring SAF imported destination with remote Queue

    you mentioned

    # Provide Remote JNDI name(This should exactly match the remote JMS destination JNDI) and click OK

    Here what do you mean by remote destination?is it a queue or a connection factory for other domain or of the same domain?

    Further you have mentioned

    Note: Please use local JNDI prefix + local JNDI name to produce messages locally, in our case it becomes safjms.saf.localjndi. To consume messages consumer has to use remote JNDI.

    If i am using Jdeveloper how will i use local JNDI prefix + local JNDI name to produce messages locally?

    ReplyDelete