当前位置: 首页 > 知识库问答 >
问题:

Wildfly 11连接到远程Artemis ActiveMQ服务器配置

车靖琪
2023-03-14

似乎到远程客户端的netty-connector不高兴!目前,我已经在本地机器上使用标准的616161端口激活了我的运行。我在https://docs.jboss.org/author/display/wfly/connect+a+pooled-connection-factory+to+a+remote+Artemis+server中遵循了说明

12:18:50,707 INFO  [org.apache.activemq.artemis.core.server] (ServerService Thread Pool -- 68) AMQ221007: Server is now live
12:18:50,707 INFO  [org.apache.activemq.artemis.core.server] (ServerService Thread Pool -- 68) AMQ221001: Apache ActiveMQ Artemis Message Broker version 1.5.5.jbossorg-008 [default,    nodeID=de747bb0-bf64-11e7-9132-887873d0243d]
12:18:50,707 INFO  [org.apache.activemq.artemis.core.server] (ServerService Thread Pool -- 68) AMQ221003: Deploying queue jms.queue.DLQ
12:18:50,739 WARN  [org.apache.activemq.artemis.jms.server] (ServerService Thread Pool -- 71) AMQ122005: Invalid "host" value "0.0.0.0" detected for "http-connector" connector. Switching to    " Demo-Laptop". If this new address is incorrect please manually configure the connector to use the proper one.
12:18:50,760 INFO  [org.wildfly.extension.messaging-activemq] (ServerService Thread Pool -- 71) WFLYMSGAMQ0002: Bound messaging object to jndi name java:jboss/exported/jms/RemoteConnectionFactory
12:18:50,760 INFO  [org.wildfly.extension.messaging-activemq] (ServerService Thread Pool -- 70) WFLYMSGAMQ0002: Bound messaging object to jndi name java:/ConnectionFactory
12:18:50,760 INFO  [org.apache.activemq.artemis.core.server] (ServerService Thread Pool -- 69) AMQ221003: Deploying queue jms.queue.ExpiryQueue
12:18:50,776 INFO  [org.jboss.as.connector.deployment] (MSC service thread 1-6) WFLYJCA0007: Registered connection factory java:/jms/remoteCF
12:18:50,776 INFO  [org.jboss.as.connector.deployment] (MSC service thread 1-3) WFLYJCA0007: Registered connection factory java:/JmsXA
12:18:50,823 INFO  [org.apache.activemq.artemis.ra] (MSC service thread 1-3) Resource adaptor started
12:18:50,823 INFO  [org.jboss.as.connector.services.resourceadapters.ResourceAdapterActivatorService$ResourceAdapterActivator] (MSC service thread 1-3) IJ020002: Deployed: file://RaActivatoractivemq-ra
12:18:50,823 INFO  [org.jboss.as.connector.deployment] (MSC service thread 1-3) WFLYJCA0002: Bound JCA ConnectionFactory [java:/JmsXA]
12:18:50,823 INFO  [org.wildfly.extension.messaging-activemq] (MSC service thread 1-7) WFLYMSGAMQ0002: Bound messaging object to jndi name java:jboss/DefaultJMSConnectionFactory
12:18:51,077 ERROR [org.apache.activemq.artemis.core.client] (Thread-0 (ActiveMQ-client-netty-threads)) AMQ214013: Failed to decode packet: java.lang.IllegalArgumentException: AMQ119032: Invalid type: 1
    at org.apache.activemq.artemis.core.protocol.core.impl.PacketDecoder.decode(PacketDecoder.java:424)
    at org.apache.activemq.artemis.core.protocol.ClientPacketDecoder.decode(ClientPacketDecoder.java:60)
    at org.apache.activemq.artemis.core.protocol.ClientPacketDecoder.decode(ClientPacketDecoder.java:39)
    at org.apache.activemq.artemis.core.protocol.core.impl.RemotingConnectionImpl.bufferReceived(RemotingConnectionImpl.java:355)
    at org.apache.activemq.artemis.core.client.impl.ClientSessionFactoryImpl$DelegatingBufferHandler.bufferReceived(ClientSessionFactoryImpl.java:1143)
    at org.apache.activemq.artemis.core.remoting.impl.netty.ActiveMQChannelHandler.channelRead(ActiveMQChannelHandler.java:69)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
    at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:293)
    at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:267)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
    at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1334)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
    at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:926)
    at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:134)
    at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:624)
    at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:559)
    at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:476)
    at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:438)
    at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:858)
    at java.lang.Thread.run(Thread.java:748)
<socket-binding-group name="standard-sockets" default-interface="public" port-offset="${jboss.socket.binding.port-offset:0}">
             …
    <outbound-socket-binding name="remote-artemis">
        <remote-destination host="localhost" port="61616"/>
    </outbound-socket-binding>
    </socket-binding-group>

<subsystem xmlns="urn:jboss:domain:messaging-activemq:2.0">
        <server name="default">
                            <remote-connector name="remote-artemis" socket-binding="remote-artemis"/>
                            ……
                            <pooled-connection-factory name="remote-artemis" entries="java:/jms/remoteCF" connectors="remote-artemis" transaction="xa" user="admin" password="admin"/>
      </server>
@Resource(lookup =" java:/jms/remoteCF")//java:/JmsXA java:jboss/DefaultJMSConnectionFactory
 static ConnectionFactory connectionFactory;

 @Resource(lookup = "java:jboss/activemq/topic/POOPOITopic")
 private static Topic pointsTopic;

try {         
    if (connectionFactory == null)
      {
          logger.severe("not finding java:/jms/remoteCF");
      }
@ResourceAdapter("remote-artemis")
//An MDB can be configured to use a pooled-connection-factory (e.g. using @ResourceAdapter). 
// In this context, the MDB leverages the inbound connector of the Artemis JCA RA.  Other kinds of clients    
//     can look up the pooled-connection-factory in JNDI (or inject it) and use it to send messages.  In this context, such a client would leverage the outbound connector of the Artemis JCA RA.  
@Inject
@JMSConnectionFactory("java:/jms/remoteCF")
private JMSContext context;

共有1个答案

叶弘深
2023-03-14

我也遇到了同样的问题(也在wildfly文档之后),但这很好。

Context jndiContext = new InitialContext();
connectionFactory =  (ConnectionFactory)jndiContext.lookup( "java:/jms/remoteCF" ); 

请注意,这里得到的不是JMSContext,而是ConnectionFactory。它可以做所有相同的事情,只是一个不同的API。

 类似资料:
  • 问题内容: 我想对redis.conf进行一些更改,以便每当我键入redis-cli时,它就会将我连接到安装在远程服务器上的redis。 我知道我们可以通过以下方式连接到安装在远程服务器上的redis: 但是实际上,我有一些bash脚本,在那些脚本中,我在很多地方都使用过redis-cli。因此,我不想以每个文件中的redis-cli -h’IP- Address-Of-Server’替换redi

  • 问题内容: 我已经使用Ubuntu 10.10服务器上http://redis.io/topics/quickstart上的快速入门指南中的说明成功安装了Redis 。我将服务作为dameon运行(因此可以通过init.d运行) 该服务器是具有内部和外部IP的Rackspace Cluster的一部分。主机在端口6379上运行(Redis的标准配置) 我在iptables中添加了一行,以允许来自端

  • Netty服务器,Fedora。我只是无法从远程主机连接到服务器,并且通过util没有显示监听套接字。但是我可以在同一台机器上建立运行客户端和服务器的连接。就像这样: 我已尝试仅使用端口、localhost IP、0.0.0.0 IP和网络IP初始化

  • sudo ufw状态:活动状态 从---------22/TCP允许任意位置10000 允许任意位置Nginx完全 允许任意位置3333 允许任意位置27017 允许任意位置22/TCP(v6) 允许任意位置(v6)10000(v6) 允许任意位置(v6)Nginx完全(v6) 允许任意位置(v6)27017(v6) 允许任意位置(v6) 从我的mac连接到它会引发错误: mongo MongoD

  • 问题内容: 我正在尝试使用以下代码从本地计算机virtualhost连接到远程MySQL服务器: 我的问题是我无法本地连接,收到错误消息: 无法连接到“ xxx.xxx.xxx.xxx”上的MySQL服务器(10060) 当我将相同的PHP文件上传到服务器时,情况并非如此。我能够毫无问题地查询数据库。 我也无法通过命令行进行连接,但是我可以访问cPanel,它排除了我的IP被意外禁止的可能性。 我

  • 本文向大家介绍pl/sql连接远程oracle服务器的配置教程,包括了pl/sql连接远程oracle服务器的配置教程的使用技巧和注意事项,需要的朋友参考一下 本文为大家分享了pl/sql连接远程oracle服务器的配置教程,具体内容如下 方法1: 打开所有程序->找到oracle-oradb11g-home1->Net Configuration Assistant 本地网络服务名配置,点击下一