First create a GridLink DataSource, but BEWARE, it should not be based on a XA driver, nor have LLR or Emulate 2PC:
http://docs.oracle.com/cd/E17904_01/web.1111/e13701/store.htm#i1143431
You cannot specify a JDBC data source that is configured to support global (XA) transactions. Therefore, the specified JDBC data source must use a non-XA JDBC driver. In addition, you cannot enable Logging Last Resource or Emulate Two-Phase Commit in the data source. This limitation does not remove the XA capabilities of layered subsystems that use JDBC stores. For example, WebLogic JMS is fully XA-capable regardless of whether it uses a file store or any JDBC store.
This is all the WLST needed:
To run the tests:
#Variable declaration
username='weblogic'
password='weblogic1'
serverurl='t3://myserver.acme.com:7101'
clustername='osbdv2cl'
#Connect with WLST to Admin
cd /opt/oracle/domains/osbdv2do
. ./bin/setDomainEnv.sh
java weblogic.WLST
connect(username, password, serverurl)
#create DataSource (non-RAC, no XA, no LLR)
datasource='JMSPerfTestDataSource'
datasource_jndi='jdbc.JMSPerfTestDataSource'
datasource_url='jdbc:oracle:thin:@myhost2.acme.com:1551:dosb01'
datasource_driver='oracle.jdbc.OracleDriver'
datasource_username='dv1_soainfra'
datasource_password='dv1_acme'
edit()
startEdit()
cmo.createJDBCSystemResource(datasource)
cd('/JDBCSystemResources/' + datasource + '/JDBCResource/' + datasource)
cmo.setName(datasource)
cd('/JDBCSystemResources/' + datasource + '/JDBCResource/' + datasource + '/JDBCDataSourceParams/' + datasource)
set('JNDINames',jarray.array([String(datasource_jndi)], String))
cd('/JDBCSystemResources/' + datasource + '/JDBCResource/' + datasource + '/JDBCDriverParams/' + datasource)
cmo.setUrl(datasource_url)
cmo.setDriverName(datasource_driver)
cmo.setPassword(datasource_password)
cd('/JDBCSystemResources/' + datasource + '/JDBCResource/' + datasource + '/JDBCConnectionPoolParams/' + datasource)
cmo.setTestTableName('SQL SELECT 1 FROM DUAL')
cd('/JDBCSystemResources/' + datasource + '/JDBCResource/' + datasource + '/JDBCDriverParams/' + datasource + '/Properties/' + datasource + '')
cmo.createProperty('user')
cd('/JDBCSystemResources/' + datasource + '/JDBCResource/' + datasource + '/JDBCDriverParams/' + datasource + '/Properties/' + datasource + '/Properties/user')
cmo.setValue(datasource_username)
cd('/JDBCSystemResources/' + datasource + '/JDBCResource/' + datasource + '/JDBCDataSourceParams/' + datasource)
cmo.setGlobalTransactionsProtocol('None')
cd('/SystemResources/' + datasource)
set('Targets',jarray.array([ObjectName('com.bea:Name=' + clustername + ',Type=Cluster')], ObjectName))
save()
activate()
#create File Store
filestore_name='LocalJMSPerfTestFileStore'
filestore_target='osbdv2ms1 (migratable)'
filestore_directory='/opt/oracle/domains/osbdv2do/servers/osbdv2ms1/data/store'
edit()
startEdit()
cd('/')
cmo.createFileStore(filestore_name)
cd('/FileStores/' + filestore_name)
cmo.setDirectory(filestore_directory)
set('Targets',jarray.array([ObjectName('com.bea:Name=' + filestore_target + ',Type=MigratableTarget')], ObjectName))
save()
activate()
#create JDBC Store
jdbcstore_name='JDBCStoreJMSPerfTest'
jdbcstore_datasource='JMSPerfTestDataSource'
jdbcstore_prefix='JMSPerfTest'
jdbcstore_target='osbdv2ms1 (migratable)'
edit()
startEdit()
cd('/')
cmo.createJDBCStore(jdbcstore_name)
cd('/JDBCStores/'+ jdbcstore_name)
cmo.setDataSource(getMBean('/SystemResources/' + jdbcstore_datasource))
cmo.setPrefixName(jdbcstore_prefix)
set('Targets',jarray.array([ObjectName('com.bea:Name=' + jdbcstore_target + ',Type=MigratableTarget')], ObjectName))
save()
activate()
#create JMS Server
cmo.createJMSServer('JMSServerPerfTest')
cd('/Deployments/JMSServerPerfTest')
cmo.setPersistentStore(getMBean('/FileStores/LocalPerfTestFileStore'))
set('Targets',jarray.array([ObjectName('com.bea:Name=osbdv2ms1,Type=Server')], ObjectName))
#create JMS Module
cd('/')
cmo.createJMSSystemResource('JMSPerfTestModule')
cd('/SystemResources/JMSPerfTestModule')
set('Targets',jarray.array([ObjectName('com.bea:Name=osbdv2cl,Type=Cluster')], ObjectName))
#create JMS SubDeployment
cmo.createSubDeployment('JMSPerfTestSD')
cd('/SystemResources/JMSPerfTestModule/SubDeployments/JMSPerfTestSD')
set('Targets',jarray.array([ObjectName('com.bea:Name=ACMECommonJmsServer1,Type=JMSServer')], ObjectName))
#create JMS Distributed Queue
cd('/JMSSystemResources/JMSPerfTestModule/JMSResource/JMSPerfTestModule')
cmo.createUniformDistributedQueue('JMSPerfDQueue')
cd('/JMSSystemResources/JMSPerfTestModule/JMSResource/JMSPerfTestModule/UniformDistributedQueues/JMSPerfDQueue')
cmo.setJNDIName('jms.JMSPerfDQueue')
cmo.setDefaultTargetingEnabled(true)
cmo.unSet('Template')
cmo.setLoadBalancingPolicy('Round-Robin')
cmo.setResetDeliveryCountOnForward(true)
cmo.setIncompleteWorkExpirationTime(-1)
cmo.setForwardDelay(-1)
cmo.setAttachSender('supports')
cmo.setSAFExportPolicy('All')
cmo.setProductionPausedAtStartup(false)
cmo.setDefaultUnitOfOrder(false)
cmo.setDefaultTargetingEnabled(false)
cmo.setUnitOfOrderRouting('Hash')
cmo.setUnitOfWorkHandlingPolicy('PassThrough')
cmo.setInsertionPausedAtStartup(false)
cmo.setMessagingPerformancePreference(25)
cmo.setConsumptionPausedAtStartup(false)
#assign SubDeployment
cmo.setSubDeploymentName('JMSPerfTestSD')
save()
activate()