简体   繁体   中英

How can I set up and test the embedded ActiveMQ Artemis server in WildFly?

I have a standalone WildFly server running and would like to setup the embedded instance of ActiveMQ Artemis, but I'm not sure if I've done it correctly. Here are the related parts from my standalone-full.xml :

<server>
    ...
    <profile>
        ...
        <subsystem xmlns="urn:jboss:domain:messaging-activemq:13.1">
            <server name="default">
                ...
                <http-connector name="http-connector" socket-binding="activemq" endpoint="http-acceptor"/>
                <http-connector name="http-connector-throughput" socket-binding="activemq" endpoint="http-acceptor-throughput">
                    <param name="batch-delay" value="50"/>
                </http-connector>

                <http-acceptor name="http-acceptor" http-listener="activemq"/>
                <http-acceptor name="http-acceptor-throughput" http-listener="activemq">
                    <param name="batch-delay" value="50"/>
                    <param name="direct-deliver" value="false"/>
                </http-acceptor>
                ...
            </server>
        </subsystem>
        ...
        <subsystem xmlns="urn:jboss:domain:undertow:12.0" default-server="default-server" default-virtual-host="default-host" default-servlet-container="default" default-security-domain="other" statistics-enabled="${wildfly.undertow.statistics-enabled:${wildfly.statistics-enabled:false}}">
            <server name="default-server">
                ...
                <http-listener name="activemq" socket-binding="activemq" enable-http2="true"/>
                ...
            </server>
        </subsystem>
        ...
    </profile>
    ...
    <socket-binding-group name="standard-sockets" default-interface="public" port-offset="${jboss.socket.binding.port-offset:0}">
        ...
        <interface name="management">
            <inet-address value="${jboss.bind.address.management:127.0.0.1}"/>
        </interface>

        <socket-binding name="managemnet" interface="activemq-interface" port="${jboss.activemq.port:8081}"/>
        ...
    </socket-binding-group>
</server>

When I try to connect to the server at tcp://localhost:8081 nothing seems to happen. Is there some tool out there that can help me examine the issue or do you guys know what might be wrong?

EDIT: Sorry guys I forgot to add a few things. I have standalone-full.xml That was a typo. However i was receving an error when using the standard configuration

AMQ122005: Invalid "host" value "0.0.0.0" detected for "http-connector" connector.

So I assumed something was badly configured and that this was the cause for not being able to reach the imbedded artemis instance. I'm unsure what the standard port is for Artemis? is it localhost:9990?

Regarding versions

Applicaiton Version
Artemis 2.19.1
Wildfly 26.1

I'm trying to connect wit the Quarkus JMS example described here https://quarkus.io/guides/jms

Why don't you use standalone-full.xml which has a complete working embedded Artemis broker. Another solution with WildFly 27 is to use Galleon and provision the embedded-activemq layer.

The AMQ122005 message is warning you that you've bound the "activemq" socket-binding which is being used by the "http-connector" http-connector to 0.0.0.0 which is not valid. A remote client looking up any JMS ConnectionFactory which is configured to use that connector will receive a stub pointing to 0.0.0.0 which won't work.

The only thing you need to do here is to instead bind the server to a concrete, remotely-accessible interface rather than 0.0.0.0 . Therefore, you don't need the extra http-listener , etc.

If you are using JNDI then you can connect embedded broker using a URL like this as demonstrated here :

http-remoting://host:8080

If you aren't using JNDI then you can connect to the embedded broker using a URL like:

tcp://host:8080?httpUpgradeEnabled=true

This is what you'd configure in Quarkus' application.properties in which case you can just ignore the AMQ122005 message since you're not using JNDI.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM