1.1.8.1., fejezet, Message Driven Bean

Wildfly 10 konfigurálása

<?xml version="1.0" ?>
 
<server xmlns="urn:jboss:domain:4.2">
    <extensions>
...
        <extension module="org.wildfly.extension.messaging-activemq"/>
...
    </extensions>
    <profile>
        <subsystem xmlns="urn:jboss:domain:ejb3:4.0">
...
            <mdb>
                <resource-adapter-ref resource-adapter-name="${ejb.resource-adapter-name:activemq-ra.rar}"/>
                <bean-instance-pool-ref pool-name="mdb-strict-max-pool"/>
            </mdb>
...
        </subsystem>
...
        <subsystem xmlns="urn:jboss:domain:messaging-activemq:1.0">
            <server name="default">
                <security-setting name="#">
                    <role name="guest" send="true" consume="true" create-non-durable-queue="true" delete-non-durable-queue="true"/>
                </security-setting>
                <address-setting name="#" dead-letter-address="jms.queue.DLQ" expiry-address="jms.queue.ExpiryQueue" max-size-bytes="10485760" page-size-bytes="2097152" message-counter-history-day-limit="10"/>
                <http-connector name="http-connector" socket-binding="messaging" endpoint="http-acceptor"/><!-- socket-binding="http" -->
                <http-connector name="http-connector-throughput" socket-binding="messaging" endpoint="http-acceptor-throughput"> <!-- socket-binding="http" -->
                    <param name="batch-delay" value="50"/>
                </http-connector>
                <in-vm-connector name="in-vm" server-id="0"/>
                <http-acceptor name="http-acceptor" http-listener="default"/>
                <http-acceptor name="http-acceptor-throughput" http-listener="default">
                    <param name="batch-delay" value="50"/>
                    <param name="direct-deliver" value="false"/>
                </http-acceptor>
                <in-vm-acceptor name="in-vm" server-id="0"/>
 
...
                <jms-queue name="ExpiryQueue" entries="java:/jms/queue/ExpiryQueue"/>
                <jms-queue name="DLQ" entries="java:/jms/queue/DLQ"/>
...
 
                <jms-topic name="jms.topic.TestTopic" entries="java:/jms/topic/testTopic java:/jboss/exported/jms/topic/testTopic"/>
 
...
 
                <connection-factory name="InVmConnectionFactory" entries="java:/ConnectionFactory" connectors="in-vm"/>
                <connection-factory name="RemoteConnectionFactory" connectors="http-connector" entries="java:jboss/exported/jms/RemoteConnectionFactory"/>
                <pooled-connection-factory name="activemq-ra" entries="java:/JmsXA java:jboss/DefaultJMSConnectionFactory" connectors="in-vm" transaction="xa"/>
            </server>
        </subsystem>
    </profile>
...
    <interfaces>
...
        <interface name="messaging-interface">
            <any-address/>
        </interface>
...
    <interfaces>
...
    <socket-binding-group name="standard-sockets" default-interface="public" port-offset="${jboss.socket.binding.port-offset:0}">
...
        <socket-binding name="messaging" interface="messaging-interface" port="8080"/>
...
    </socket-binding-group>
</server>

Queue vagy Topic létrehozása cli-vel

[standalone@localhost:9999 /] jms-queue add --queue-address= jms.queue.ExampleQueue --entries=java:/jms/queue/exampleQueue,java:/jboss/exported/jms/queue/exampleQueue
[standalone@localhost:9999 /] jms-topic add --topic-address=jms.topic.ExampleTopic --entries=java:/jms/topic/exampleTopic,java:/jboss/exported/jms/topic/exampleTopic