How to set up messaging subsystem using CLI in Wildfly

后端 未结 3 1112
感动是毒
感动是毒 2020-12-31 10:19

Does anyone have an example script for setting up the messaging subsystem in Wildfly using CLI?

The perfect example would be the CLI needed to take a server running

3条回答
  •  傲寒
    傲寒 (楼主)
    2020-12-31 10:30

    Here is an updated CLI command for new Wildfly 10 (ActiveMQ Artemis)

    >> ADD MESSAGING SUBSYSTEM

    /extension=org.wildfly.extension.messaging-activemq:add()
    /subsystem=messaging-activemq:add
    /:reload
    /subsystem=messaging-activemq/server=default:add
    /subsystem=messaging-activemq/server=default/security-setting=#:add
    /subsystem=messaging-activemq/server=default/address-setting=#:add(dead-letter-address="jms.queue.DLQ", expiry-address="jms.queue.ExpiryQueue", expiry-delay="-1L", max-delivery-attempts="10", max-size-bytes="10485760", page-size-bytes="2097152", message-counter-history-day-limit="10")
    /subsystem=messaging-activemq/server=default/http-connector=http-connector:add(socket-binding="http", endpoint="http-acceptor")
    /subsystem=messaging-activemq/server=default/http-connector=http-connector-throughput:add(socket-binding="http", endpoint="http-acceptor-throughput" ,params={batch-delay="50"})
    /subsystem=messaging-activemq/server=default/in-vm-connector=in-vm:add(server-id="0")
    /subsystem=messaging-activemq/server=default/http-acceptor=http-acceptor:add(http-listener="default")
    /subsystem=messaging-activemq/server=default/http-acceptor=http-acceptor-throughput:add(http-listener="default", params={batch-delay="50", direct-deliver="false"})
    /subsystem=messaging-activemq/server=default/in-vm-acceptor=in-vm:add(server-id="0")
    /subsystem=messaging-activemq/server=default/jms-queue=ExpiryQueue:add(entries=["java:/jms/queue/ExpiryQueue"])
    /subsystem=messaging-activemq/server=default/jms-queue=DLQ:add(entries=["java:/jms/queue/DLQ"])
    

    >> Refresh needed at this point

    /subsystem=messaging-activemq/server=default/connection-factory=InVmConnectionFactory:add(connectors=["in-vm"], entries=["java:/ConnectionFactory"])
    /subsystem=messaging-activemq/server=default/connection-factory=RemoteConnectionFactory:add(connectors=["http-connector"], entries = ["java:jboss/exported/jms/RemoteConnectionFactory"])
    /subsystem=messaging-activemq/server=default/pooled-connection-factory=activemq-ra:add(transaction="xa", connectors=["in-vm"], entries=["java:/JmsXA java:jboss/DefaultJMSConnectionFactory"])
    /subsystem=ee/service=default-bindings/:write-attribute(name="jms-connection-factory", value="java:jboss/DefaultJMSConnectionFactory")
    /subsystem=ejb3:write-attribute(name="default-resource-adapter-name", value="${ejb.resource-adapter-name:activemq-ra.rar}")
    /subsystem=ejb3:write-attribute(name="default-mdb-instance-pool", value="mdb-strict-max-pool")
    

    >> ADD MESSAGE QUEUE

    /subsystem=messaging-activemq/server=default/jms-queue=MyQueue:add(entries=[java:/jms/queue/MyQueue])
    

    All commands may be ran as a batch command or separately like this:

    $SERVER_CLI_PATH --connect --user=$SERVER_USER --password=$SERVER_PASSW --command="{{line with command}}"
    

提交回复
热议问题