The MessageQueueListener component receives messages from a JMS (Java Message Service) service. The MessageQueueListener component must be used as the listener component of a Global Automatic.
The MessageQueueListener component takes the following parameters for initialization:
| Parameter | Required? | Description |
|---|---|---|
| contextFactory | Yes | Class name of the JNDI context factory used to locate the Queue and the QueueConnectionFactory |
| providerURL | Yes | Base URL of the naming service |
| securityPrincipal | No | Security principal that authenticates against the naming service (for example, username) |
| securityCredentials | No | Credentials required to authenticate against the naming service (for example, password) |
| factoryName | Yes | JNDI name of the QueueConnectionFactory |
| queueName | Yes | JNDI name of the Queue |
| jmsUsername | No | Username that authenticates with the JMS provider |
| jmsPassword | No | Password that authenticates with the JMS provider |
| transacted | No | Specifies whether the session will be transacted |
The code below uses the parameters described in the table to connect to a queue found in an LDAP server. In the example, componentArguments is a predefined variable where initialization parameters are passed to the component:
componentArguments = [
"contextFactory" : "com.sun.jndi.ldap.LdapCtxFactory",
"providerURL" : "ldap://gollum:30112/o=cs,c=us",
"securityPrincipal" : "cn=root",
"securityCredentials" : "password",
"factoryName" : "cn=myQCF",
"queueName" : "cn=myQueue",
"jmsUsername" : "juancn",
"jmsPassword" : "mypasswd",
"transacted" : "false"
]