This page contains a common JMS configuration.
JMS component configuration:
This article describes the JMS component configuration - it defines all JMS components which will be used in MC2.
...
...
title | Path to components |
---|
...
...
...
...
The following is a common configuration format of components.json:
components.json
Code Block | ||
---|---|---|
|
...
{ "Components": [ |
...
//* ActiveMQ: { "componentName": "eagle-amq", |
...
"componentClass": "org.apache.activemq.camel.component.ActiveMQComponent", |
...
|
...
|
...
|
...
|
...
"connectionFactory": "#{wrapper:amqconnPool_native[amqConnFactory]}" //"#{cf:amqConnFactory}" }, { "componentName": "eagle-amq- |
...
tds", |
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
"componentClass": "org.apache.activemq.camel.component. |
...
ActiveMQComponent", |
...
"connectionFactory": "#{wrapper: |
...
single_amqconnPool_native[amqConnFactoryTds]}" //"#{cf:amqConnFactory}" }, |
...
{ "componentName": "eagle-amq-no-pool", |
...
"componentClass": "org.apache.activemq.camel.component.ActiveMQComponent", " |
...
connectionFactory": " |
...
#{wrapper:single_amqconnPool_native[amqConnFactory]}" }, //* IBM WebSphere |
...
MQ (IBM MQ): { " |
...
componentName": " |
...
wmq", |
...
|
...
"componentClass": "org.apache.camel.component.jms.JmsComponent", |
...
"connectionFactory": "#{wrapper:connPool[wmqConnFactory]}"//"#{cf:wmqConnFactory}" |
...
}, |
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
{ " |
...
componentName": " |
...
wmq-tds", |
...
|
...
"componentClass": "org.apache.camel.component.jms.JmsComponent", "connectionFactory": "#{wrapper:single_connPool[wmqConnFactory]}"//"#{cf: |
...
wmqConnFactory}" |
...
}, |
...
{ |
...
|
...
|
...
"componentName": "wmq-no-pool", |
...
" |
...
componentClass": " |
...
org.apache. |
...
camel. |
...
component.jms. |
...
JmsComponent", " |
...
connectionFactory": |
...
"#{cf:wmqConnFactory}" } |
...
|
...
//============================ Components with SSL ================================== , { |
...
"componentName": "wmqssl", " |
...
componentClass": |
...
" |
...
org.apache.camel.component.jms.JmsComponent", "connectionFactory": "#{wrapper:connPool[wmqConnFactorySSL]}" }, { |
...
"componentName": "wmqssl-no-pool", |
...
"componentClass": " |
...
org.apache.camel.component.jms.JmsComponent", "connectionFactory": "#{cf:wmqConnFactorySSL}" }, { "componentName": "eagle-amqssl", |
...
|
...
|
...
"componentClass": "org.apache.activemq.camel.component.ActiveMQComponent", "connectionFactory": "#{wrapper:amqconnPool_native[amqConnFactorySSL]}" }, { |
...
"componentName": "eagle-amqssl-no-pool", |
...
"componentClass": "org.apache.activemq.camel.component.ActiveMQComponent", " |
...
connectionFactory": |
...
"#{cf:amqConnFactorySSL}" } ] , "ConnectionFactories": { //*** reference: cf |
...
|
...
" |
...
wmqConnFactory": |
...
{ "class": "com.ibm.mq.jms.MQConnectionFactory" } |
...
|
...
|
...
, |
...
|
...
|
...
" |
...
amqConnFactory": { "class": "org. |
...
apache. |
...
activemq. |
...
ActiveMQConnectionFactory", "parameters": { " |
...
UserName": "#{ |
...
stream: |
...
USERID}", " |
...
Password": " |
...
#{stream:USERPASSWORD}"} } , "amqConnFactoryTds": { "class": "org.apache.activemq.ActiveMQConnectionFactory", //* |
...
AMQ connection factory for topic durable subscription |
...
|
...
"parameters": { "UserName": "#{stream:USERID}", |
...
|
...
|
...
|
...
|
...
" |
...
Password": |
...
"#{stream:USERPASSWORD}", |
...
|
...
|
...
|
...
|
...
"ClientID": "#{stream:CLIENT_ID}" } } |
...
|
...
, "wmqConnFactorySSL": { "class": "com.ibm.mq.jms.MQConnectionFactory", |
...
"parameters": { "SSLFipsRequired" : false , |
...
|
...
|
...
|
...
|
...
"SSLSocketFactory": "#{instance:SSLSocketFactory}" , |
...
...
" |
...
SSLCipherSuite" |
...
|
...
|
...
: " |
...
TLS_RSA_WITH_AES_128_CBC_SHA256" } } , " |
...
amqConnFactorySSL": { " |
...
class": " |
...
org.apache.activemq.ActiveMQSslConnectionFactory", |
...
"parameters": { "KeyAndTrustManagers": " |
...
#{instance:KeyAndTrustManagers}", |
...
" |
...
UserName": " |
...
#{stream:USERID}", |
...
|
...
"Password": "#{stream:USERPASSWORD}" } } } , |
...
"Wrappers": |
...
{ "connPool<T>": { "class": "org.springframework.jms.connection.CachingConnectionFactory", // #{wrapper:connPool[wmqConnFactory]} |
...
|
...
"parameters": |
...
{ "setTargetConnectionFactory": "#{cf:<T>}", |
...
...
Note | ||
---|---|---|
| ||
MC2 provides out-of-box configuration – we will store all predefined components in a single file, but users are able to extend number of JMS components by creation of new component-*.json file similar one above. |
JMS connection configuration:
Configuration files of JMS connections are stored by this path:
Info | ||
---|---|---|
| ||
estar/tpe/dynamic/mc2/eaglejms/connections/*.json |
Format of JMS configuration of connections:
...
"setSessionCacheSize": "100"
},
"init_method": "initConnection",
"destroy_method": "by default"
}
,
"single_connPool<T>": { "class": "org.springframework.jms.connection.SingleConnectionFactory", // #{wrapper:connPool[wmqConnFactory]}
"parameters": { "setTargetConnectionFactory": "#{cf:<T>}",
"ClientId": "#{stream:CLIENT_ID}"
},
"init_method": "initConnection",
"destroy_method": "destroy"
}
,
"amqconnPool": { "class": "org.springframework.jms.connection.CachingConnectionFactory",
"parameters": { "TargetConnectionFactory": "#{cf:amqConnFactory}",
"SessionCacheSize": "10"
},
"init_method": "initConnection",
"destroy_method": "by default"
}
,
"amqconnPool_native<T>": { "class": "org.apache.activemq.pool.PooledConnectionFactory",
"parameters": { "ConnectionFactory": "#{cf:<T>}"
},
"init_method": "start",
"destroy_method": "stop"
}
,
"single_amqconnPool_native<T>": { "class": "org.apache.activemq.pool.PooledConnectionFactory",
"parameters": { "ConnectionFactory": "#{cf:<T>}",
"MaxConnections": "1",
"MaximumActiveSessionPerConnection": "1"
},
"init_method": "start",
"destroy_method": "stop"
}
}
}
|
JMS Connection Configuration
The configuration files of JMS connections are stored by this path:
Info |
---|
Path to connectionsestar/tpe/dynamic/mc2/eaglejms/connections/*.json |
This is an example of the format of JMS configuration of connections:
connections.json
Code Block | ||
---|---|---|
| ||
{
"Region": "Specific Oracle SID of the region", /*Specific Oracle SID of region name to which this config belongs*/
"Connections": [
{
"ConnectionName": "mywmq.connection", /* do NOT use underscore character ("_") in name*/
"ComponentName": "wmq", /* reference to component name defined in components.json */
"Parameters": { // Some specific parameters
"port": 1415,
"ctransportType": 1 ,
"clientID": "client ID" /* sets Client ID */
},
/* JNDI has a higher priority: if not null then this object will be used as a JMS
connection factory */
//"JndiConnectionFactory": "my.jndi.connection.factory1"
}
]
}
|
JndiConnectionFactory - property is not supported yet.
You may need to make a JMS Connection configuration for more than one JMS Component. For example, when you interact with more than one JMS broker. In this case, you would add one more section in connection.json config, as shown in the example below:
connections.json
Code Block | ||
---|---|---|
| ||
{
"Region": "Specific Oracle SID of the region", /*Specific Oracle |
...
SID of region name to which this config belongs*/ "Connections": [ |
...
{ // First connection "ConnectionName": "my.FIRST.amq.connection", /* do NOT use underscore character |
...
(" |
...
_" |
...
) |
...
in name*/ |
...
|
...
|
...
|
...
|
...
|
...
" |
...
ComponentName": " |
...
amq", /* |
...
reference |
...
to |
...
component |
...
name defined in components.json */ /* JNDI has a higher priority: if not null then this object will be used as a JMS |
...
|
...
connection factory */
//"JndiConnectionFactory": "my.jndi.connection. |
...
factory", |
...
|
...
|
...
|
...
|
...
|
...
" |
...
Parameters": { " |
...
brokerURL": " |
...
tcp://*****.eagleinvsys.com:61616" /* |
...
connection url (AMQ): Host name |
...
or IP |
...
+ |
...
port */ } }, |
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
|
...
{ |
...
// |
...
Second connection |
...
config |
...
" |
...
ConnectionName": "my.jndi |
...
.wmq.connection", /* do NOT use underscore character ("_") in name*/ |
...
"ComponentName": "wmq", /* |
...
reference |
...
Note | ||
---|---|---|
| ||
JndiConnectionFactory - property is not supported yet. |
In case if you suddenly for some reason need to make a JMS Connection configuration for more than one JMS Component (for instance, you need to interract with couple of JMS brokers),
you have to just add one more section in connection.json config, like in example below:
...
language | js |
---|---|
theme | RDark |
title | connections.json |
linenumbers | true |
...
to component name defined in components.json */ "Parameters": { // Some specific parameters "transportType": 1, "port": 1414, "channel": "", "queueManager": "", "HostName": "" } /* JNDI has a higher priority: if not null then this object will be used as a JMS connection factory */ //" |
...
JndiConnectionFactory": "my. |
...
jndi. |
...
connection. |
...
factory" } ] |
...
}
|
Info |
---|
ConnectionName - all connection names must be unique
|
Consider the following example of adding a User Name and Password, if you have to connect to JMS broker with your credentials:
connections.json
Code Block | ||
---|---|---|
| ||
{ "Region": "Specific Oracle SID of the region", /*Specific Oracle SID of region name to which this config belongs*/ "Connections": [ { " |
...
ConnectionName": " |
...
myactivemq.connection", "ComponentName": "eagle-amq", |
...
|
...
"Parameters": { |
...
|
...
" |
...
brokerURL": " |
...
tcp://xxxxxx.eagleinvsys.com:61616", / |
...
* connection url: Host name or IP + port */ " |
...
UserName": " |
...
#{stream:USERID}", /* |
...
just copy it as is - it will be JMS Connection User value from Stream parameters*/ |
...
|
...
|
...
|
...
|
...
"Password": "#{stream:USERPASSWORD}" /* just copy it as is - it will be |
...
JMS |
...
Connection |
...
Password |
...
value |
...
from |
...
Stream parameters*/ |
...
|
...
}, |
...
|
...
/* JNDI has a higher priority: if not null then this object will |
...
be used as a JMS connection |
...
factory */ |
...
//"JndiConnectionFactory": "my.jndi.connection.factory1" } |
...
]
}
|
...
We should pay attention to some moments:
- ConnectionName - all connection names must be unique!
- ComponentName - we refer to the same conponent name defined in components.json config.
- all other parameters have to be specific for your purpose.
...
External Vendor Libraries
In most cases, to
...
enable JMS Messaging
...
, you
...
need to make all dependencies available to
...
MC2.
All external dependencies
...
must be stored ineagle/estar/tpe/dynamic/mc2/sharedlibs/.