Nav
You are viewing an older version of this section. Click here to navigate to the latest version.

JBoss JMS Integration

To use JBoss JMS and the built-in JBoss TS, ensure that the JBoss AS version is at least 6.0.x.

You configure a JBoss JMS connector for Mule as follows:


       
    
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns:jbossts="http://www.mulesoft.org/schema/mule/jbossts"
        xmlns:stdio="http://www.mulesoft.org/schema/mule/stdio"
        xmlns:servlet="http://www.mulesoft.org/schema/mule/servlet" xmlns:jms="http://www.mulesoft.org/schema/mule/jms" xmlns:quartz="http://www.mulesoft.org/schema/mule/quartz" xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns:wmq="http://www.mulesoft.org/schema/mule/ee/wmq" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation" xmlns="http://www.mulesoft.org/schema/mule/core"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:spring="http://www.springframework.org/schema/beans"
       xmlns:pop3="http://www.mulesoft.org/schema/mule/pop3"
       xmlns:vm="http://www.mulesoft.org/schema/mule/vm"
       xmlns:file="http://www.mulesoft.org/schema/mule/file"
       xmlns:email="http://www.mulesoft.org/schema/mule/email"
       xsi:schemaLocation="
http://www.mulesoft.org/schema/mule/jbossts http://www.mulesoft.org/schema/mule/jbossts/current/mule-jbossts.xsd
http://www.mulesoft.org/schema/mule/stdio http://www.mulesoft.org/schema/mule/stdio/current/mule-stdio.xsd">

    <jbossts:transaction-manager/>

    <configuration>
        <default-dispatcher-threading-profile maxThreadsActive="50" maxThreadsIdle="25"
            threadTTL="60000"/>
        <default-receiver-threading-profile maxThreadsActive="50" maxThreadsIdle="25"
            threadTTL="60000"/>
        <default-service-threading-profile maxThreadsActive="50" maxThreadsIdle="25"
            threadTTL="60000"/>
    </configuration>

    <jms:connector name="jms-connector" jndiInitialFactory="org.jnp.interfaces.NamingContextFactory"
        jndiProviderUrl="jnp://127.0.0.1:1099"
        connectionFactoryJndiName="java:/QueueConnectionFactory" jndiDestinations="true"
        forceJndiDestinations="true" disableTemporaryReplyToDestinations="true">
        <!--retry:forever-policy frequency="2000"/-->
    </jms:connector>

    <stdio:connector name="stdioConnector" promptMessage="Please enter message: "  outputMessage="Received message: " messageDelayTime="3000"/>

    <jms:object-to-jmsmessage-transformer name="ObjectToJMSMessageTransformer"/>

    <jms:jmsmessage-to-object-transformer name="JMSMessageToObjectTransformer"/>

        <stdio:connector name="stdio" promptMessage="Yes? " messageDelayTime="1000"/>

    <flow name="stdioToQueue">
        <stdio:inbound-endpoint system="IN" exchange-pattern="request-response"/>
        <jms:outbound-endpoint queue="queue/testQueue" exchange-pattern="request-response"/>
    </flow>


    <flow name="queueToStdio">
        <jms:inbound-endpoint queue="queue/testQueue" exchange-pattern="request-response"/>
        <stdio:outbound-endpoint system="OUT" exchange-pattern="request-response"/>
    </flow>
</mule>

The JNDI provider and JBoss properties are specified in Spring.

If you use user credentials to connect to JBoss MQ, make sure that the user has the 'guest' role assigned to it. This will ensure that there are no issues if temporary topics or queues are used.