A Resource Adapter is deployed as an archive with extension 'rar'. SwiftMQ provides 2 'rar' archives:
Both files are located in the "j2ee" sub-directory of the SwiftMQ router distribution.
You need to deploy the file "swiftmq.rar". The following configuration properties of the Resource Adapter can be overwritten during the deployment:
| Property Name | Type | Default Value | Description |
|---|---|---|---|
| ProviderURL | java.lang.String | smqp://localhost:4001/timeout=10000 | JNDI provider URL to connect to SwiftMQ's JNDI. |
| DebugMode | java.lang.Boolean | false | If set to true, the RA prints debug output to System.out. |
| AllowOnePhase | java.lang.Boolean | depends | Since 7.0.2: Allows one phase commit optimizations. Default is true for non-HA and false for SwiftMQ HA Router. |
SwiftMQ's Resource Adapter uses a JNDI context to lookup JMS connection factories to create ManagedConnections. The property "ProviderURL" sets the SMQP-URL to create our JNDI context. After successful deployment of the Resource Adapter you should see an active connection in the Network Swiftlet if you connect to the SwiftMQ Router with SwiftMQ Explorer. This connection is the JMS connection used from SwiftMQ's JNDI context.
If your application server doesn't provide a way to set a log writer at the Resource Adapter, you can set the property "DebugMode" to true which forces the Resource Adapter to set its own log writer which prints debug output to System.out. We recommend to run it in debugging mode if you deploy it for the first time or when you detect problems.
The application server can use one-phase optimization if multiple branches of the same XA transaction belong to the same resource. For example, it is the case if a message is received by an MDB out of a SwiftMQ queue of the same router and sent from the same MDB to another queue on the same router. The property "AllowOnePhase" enables or disables this optimization. It MUST be disabled if SwiftMQ HA Router is used, otherwise there might be a problem with the recovery of unfinished one-phase XA transactions during failover. The property should be enabled if the non-HA SwiftMQ Router is used.
You need to deploy the file "swiftmq-ivm.rar". The following configuration properties of the Resource Adapter can be overwritten during the deployment:
| Property Name | Type | Default Value | Description |
|---|---|---|---|
| ProviderURL | java.lang.String | smqp://intravm/timeout=10000 | JNDI provider URL to connect to SwiftMQ's JNDI. |
| DebugMode | java.lang.Boolean | false | If set to true, the RA prints debug output to System.out. |
| IntraVM | java.lang.Boolean | true | Specifies that the routers runs intraVM. |
| RouterWorkingDirectory | java.lang.String | <swiftmq_dir>/scripts/unix | Must point to the "scripts/<platform>" of your SwiftMQ distribution. |
| ConfigurationFilename | java.lang.String | ../../config/router1/routerconfig.xml | Relative path from the "RouterWorkingDirectory" to the router's configuration file. |
| AllowOnePhase | java.lang.Boolean | true | Since 7.0.2: Allows one phase commit optimizations. |
The properties "ProviderURL" and "DebugMode" are described in the section above. The default value of the "ProviderURL" here contains a SMQP-URL which uses an intraVM connection.
The property "IntraVM" tells the Resource Adapter to start the SwiftMQ router intraVM during the start of the Resource Adapter and stop it when the Resource Adapter is stopped. It uses the values of the properties "RouterWorkingDirectory" and "ConfigurationFilename" to start the router.
Because the SwiftMQ router runs inside the JVM of the application server, several permissions must be granted, otherwise you'll probably get security exceptions during startup. The permissions are defined in the "ra.xml" which is stored within the "swiftmq-ivm.jar". If your application server is not able to activate the grants from the "ra.xml" automatically, then you should do it yourself. For example, for the J2EE 1.4 Reference Implementation you need to put the grant statements into the "server.policy" file and restart the application server.
The required permissions are:
grant {
permission java.lang.RuntimePermission "getClassLoader";
permission java.lang.RuntimePermission "createClassLoader";
permission java.lang.RuntimePermission "modifyThread";
permission java.lang.RuntimePermission "stopThread";
permission java.lang.RuntimePermission "modifyThreadGroup";
permission java.net.SocketPermission "*", "accept, connect, listen";
permission java.io.FilePermission "<<ALL FILES>>", "read, write, delete, execute";
};
After deployment (and a possible restart of the application server) you should see SwiftMQ's startup output in System.out. Connect with the SwiftMQ Explorer and you see a "INTRAVM-0" connection in the Network Swiftlet. This is the JMS connection from the JNDI context.