prasanthjames

Weblogic JMS SAF with WLST

Jun 24th, 2014
615
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 3.77 KB | None | 0 0
  1. # This WLST will connect to the 'local' weblogic server
  2. # and create a remote SAF connection as mentioned below.
  3. # It is written to create a SystemModule-0 JMS Module,
  4. # Create two connection factories (XA and non-XA),
  5. # RemoteContext, SAFImportedDestination
  6. # and a remorte queue for EDN setup on a non-SOA weblogic.
  7. # However, the script can be modified to create any JMS object.
  8.  
  9. # Make sure to edit/verify the lines at <---XXX---> comments
  10. # to suit the environment
  11.  
  12.  
  13. #connect('weblogic', 'welcome1', 'soabpm-vm.site:7001')
  14. connect()
  15.  
  16. edit()
  17.  
  18. startEdit()
  19.  
  20. #Create SAF Agent
  21. cd('/')
  22.  
  23. cmo.createSAFAgent('SAFAgent-0')
  24.  
  25. cd('/SAFAgents/SAFAgent-0')
  26.  
  27. cmo.setServiceType('Sending-only')
  28.  
  29. #JMS Module
  30. cd('/')
  31.  
  32. cmo.createJMSSystemResource('SystemModule-0')
  33.  
  34. cd('/SystemResources/SystemModule-0')
  35.  
  36. #<-------------Specify the JMS Module target- server, cluster,etc. ------->
  37. set('Targets',jarray.array([ObjectName('com.bea:Name=AdminServer,Type=Server')], ObjectName))
  38.  
  39. #Remote SAF Context
  40. cd('/JMSSystemResources/SystemModule-0/JMSResource/SystemModule-0')
  41.  
  42. cmo.createSAFRemoteContext('RemoteSAFContext-0')
  43.  
  44. cd('/JMSSystemResources/SystemModule-0/JMSResource/SystemModule-0/SAFRemoteContexts/RemoteSAFContext-0/SAFLoginContext/RemoteSAFContext-0')
  45.  
  46. #<----Specify remote server host, user,pwd ------>
  47. cmo.setLoginURL('t3://soabpm-vm.site:7001')
  48. cmo.setUsername('weblogic')
  49. cmo.setPassword('welcome1')
  50.  
  51. cd('/JMSSystemResources/SystemModule-0/JMSResource/SystemModule-0')
  52.  
  53. #Create EDN connection factories
  54. #<--------Specify connection factory JNDI names -------->
  55. cmo.createConnectionFactory('EDNConnectionFactory');
  56. cd('/JMSSystemResources/SystemModule-0/JMSResource/SystemModule-0/ConnectionFactories/EDNConnectionFactory')
  57. cmo.setJNDIName('jms/fabric/EDNConnectionFactory')
  58. cmo.setDefaultTargetingEnabled(true)
  59. cd('/JMSSystemResources/SystemModule-0/JMSResource/SystemModule-0/ConnectionFactories/EDNConnectionFactory/TransactionParams/EDNConnectionFactory')
  60. cmo.setXAConnectionFactoryEnabled(true)
  61.  
  62. cd('/JMSSystemResources/SystemModule-0/JMSResource/SystemModule-0')
  63. cmo.createConnectionFactory('XAEDNConnectionFactory')
  64. cd('/JMSSystemResources/SystemModule-0/JMSResource/SystemModule-0/ConnectionFactories/XAEDNConnectionFactory')
  65. cmo.setJNDIName('jms/fabric/xaEDNConnectionFactory1')
  66. cmo.setDefaultTargetingEnabled(true)
  67.  
  68.  
  69.  
  70.  
  71. cd('/JMSSystemResources/SystemModule-0/JMSResource/SystemModule-0')
  72.  
  73. cmo.createSAFImportedDestinations('SAFImportedDestinations-0')
  74. cd('/JMSSystemResources/SystemModule-0/JMSResource/SystemModule-0/SAFImportedDestinations/SAFImportedDestinations-0')
  75. cmo.setSAFRemoteContext(getMBean('/JMSSystemResources/SystemModule-0/JMSResource/SystemModule-0/SAFRemoteContexts/RemoteSAFContext-0'))
  76. cmo.setSAFErrorHandling(None)
  77. cmo.setTimeToLiveDefault(0)
  78. cmo.setUseSAFTimeToLiveDefault(false)
  79. cmo.setDefaultTargetingEnabled(true)
  80.  
  81. #SAF Queue
  82. cmo.createSAFQueue('SAFQueue-1')
  83.  
  84.  
  85. cd('/JMSSystemResources/SystemModule-0/JMSResource/SystemModule-0/SAFImportedDestinations/SAFImportedDestinations-0/SAFQueues/SAFQueue-1')
  86.  
  87. #<---------Specify the remote queue name. Currently configured for EDN Queue------------>
  88. cmo.setRemoteJNDIName('jms/fabric/EDNQueue')
  89.  
  90. cmo.setNonPersistentQos('At-Least-Once')
  91. cmo.setTimeToLiveDefault(0)
  92. cmo.setUseSAFTimeToLiveDefault(false)
  93. cmo.setUnitOfOrderRouting('Hash')
  94.  
  95. cd('/JMSSystemResources/SystemModule-0/JMSResource/SystemModule-0/SAFImportedDestinations/SAFImportedDestinations-0/MessageLoggingParams/SAFImportedDestinations-0')
  96. cmo.setMessageLoggingEnabled(false)
  97. cmo.setMessageLoggingEnabled(true)
  98. cmo.setMessageLoggingFormat('%header%,JMSCorrelationID,JMSDeliveryMode,JMSDestination,JMSExpiration,JMSMessageID,JMSPriority,JMSRedelivered,JMSReplyTo,JMSTimestamp,JMSType,%properties%')
  99.  
  100.  
  101. cd('/')
  102.  
  103.  
  104. activate()
Advertisement
Add Comment
Please, Sign In to add comment