Friday, April 27, 2012

Configuring SAF agent

Below are the steps on how to create a SAF agent with file persistent store that receives messages from a publisher and forwards to another JMS server configured with JDBC persistent store.
Create two Domain1 and Domain2. Domain1 will be configured with SAF agent where as Domain2 will be configured with destinations where the consumer will listen to receive and process messages.
Domain2 configuration
  • Create JDBC data store
  • Create Persistent store based on the above JDBC data source
  • Create a new JMS server based on this JDBC persistent store
  • Create a new JMS module
  • Create a new Subdeployment for this JMS module and choose the JMS server created above
  • Create a new Connection factory
  • Create a new Queue and configure this to use the subdeployment
Domain1 configuration
  1. Create File based persistent store
  2. Create a new JMS server based on this JDBC persistent store
  3. Create a new Store-And-Forward agent.
    1. Since we are using JMS, this can only be a "Send-only" agent. 
    2. Also make sure "Logging enabled" option is selected. This allows the message to be logged in the server log file
  4. Create a new JMS module
  5. Create "Remote SAF Context" resource
    1. select the name of the remote SAF context
    2. provide the URL context for the SAF agent to login. This will be pointing to domain2 we created above.
    3. provide the credentials to logon to the aboe domain
  6. Create "SAF Error Handling" resource
    1. choose the name
    2. set Message Handling Policy to "Always-forward" since we are neither interested in discarding any messages nor re-directing them to error destination
  7. Create a new Connection factory
  8. Create a new "SAF Imported Destinations" resource in the JMS module
    1. select Remote SAF Context created above
    2. select SAF Error Handling resource created in previous step
  9. After creating the "SAF Imported Destinations" and saving the configuration, create required SAF destinations for the remote destinations
    1. create a new Queue
    2. choose Queue name
    3. choose Remote JNDI name. This will be the destination JNDI name configured in Domain2
    4. Save the Queue
    5. Select the Queue and provide "Local JNDI Name". This will be used by the publisher to publish any messages to this destination
This should configure the SAF agent to forward the messages successfully to the remote destinations. Now we can publish a message to the SAF destination and consume messages on the remote destination.


No comments:

Post a Comment