日日操夜夜添-日日操影院-日日草夜夜操-日日干干-精品一区二区三区波多野结衣-精品一区二区三区高清免费不卡

公告:魔扣目錄網(wǎng)為廣大站長(zhǎng)提供免費(fèi)收錄網(wǎng)站服務(wù),提交前請(qǐng)做好本站友鏈:【 網(wǎng)站目錄:http://www.ylptlb.cn 】, 免友鏈快審服務(wù)(50元/站),

點(diǎn)擊這里在線咨詢客服
新站提交
  • 網(wǎng)站:51998
  • 待審:31
  • 小程序:12
  • 文章:1030137
  • 會(huì)員:747

本文介紹了客戶端工具M(jìn)QTT.fx上定義的主題未使用ActiveMQ Artemis消息的處理方法,對(duì)大家解決問(wèn)題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)吧!

問(wèn)題描述

我的用例保證使用發(fā)布-訂閱模型,因此我使用在我的Spring Boot客戶端中定義的主題。我已經(jīng)使用工具M(jìn)QTT.fx和兩個(gè)Spring Boot客戶端進(jìn)行了測(cè)試。兩個(gè)Spring Boot客戶端能夠相互通信,但MQTT.fx客戶端只連接到代理,不生成或使用消息。兩個(gè)Spring Boot客戶端都連接到端口61616,而MQTT.fx客戶端連接到端口1883

對(duì)于我的項(xiàng)目,我需要讓MQTT.fx客戶端工作,因?yàn)樗叨却泶蛩闩c服務(wù)器一起工作的微控制器。MQTT.fx上的故障就是微控制器上的故障。

broker.xml文件中的acceptor配置如下所示。

<acceptors>
     <!-- Acceptor for every supported protocol -->
     <acceptor name="artemis">tcp://0.0.0.0:61616?tcpSendBufferSize=1048576;tcpReceiveBufferSize=1048576;amqpMinLargeMessageSize=102400;protocols=CORE,AMQP,STOMP,HORNETQ,MQTT,OPENWIRE;useEpoll=true;amqpCredits=1000;amqpLowCredits=300;amqpDuplicateDetection=true;supportAdvisory=false;suppressInternalManagementObjects=false</acceptor>

     <!-- AMQP Acceptor.  Listens on default AMQP port for AMQP traffic.-->
     <acceptor name="amqp">tcp://0.0.0.0:5672?tcpSendBufferSize=1048576;tcpReceiveBufferSize=1048576;protocols=AMQP;useEpoll=true;amqpCredits=1000;amqpLowCredits=300;amqpMinLargeMessageSize=102400;amqpDuplicateDetection=true</acceptor>

     <!-- STOMP Acceptor. -->
     <acceptor name="stomp">tcp://0.0.0.0:61613?tcpSendBufferSize=1048576;tcpReceiveBufferSize=1048576;protocols=STOMP;useEpoll=true</acceptor>

     <!-- HornetQ Compatibility Acceptor.  Enables HornetQ Core and STOMP for legacy HornetQ clients. -->
     <acceptor name="hornetq">tcp://0.0.0.0:5445?anycastPrefix=jms.queue.;multicastPrefix=jms.topic.;protocols=HORNETQ,STOMP;useEpoll=true</acceptor>

     <!-- MQTT Acceptor -->
     <acceptor name="mqtt">tcp://0.0.0.0:1883?tcpSendBufferSize=1048576;tcpReceiveBufferSize=1048576;protocols=MQTT;useEpoll=true</acceptor>
</acceptors>

Spring Boot客戶端通信時(shí)的日志如下。首先,向主題server.weatherForecast發(fā)送一條消息,然后,經(jīng)過(guò)一些處理后,向AMEBAA000105.device.weatherForecast發(fā)送響應(yīng)。

2021-10-04 14:14:04,860 [AUDIT](Thread-8 (activemq-netty-threads)) 

AMQ601715: User admin(admins)@127.0.0.1:1125 successfully authenticated
2021-10-04 14:14:04,860 [AUDIT](Thread-8 (activemq-netty-threads)) AMQ601267: User admin(admins)@127.0.0.1:1125 is creating a core session on target resource ActiveMQServerImpl::name=0.0.0.0 [with parameters: [3b141c41-24ef-11ec-aa52-00155d831300, null, ****, 102400, RemotingConnectionImpl [ID=6280c69f, clientID=null, nodeID=b719c384-1d0a-11ec-8b7c-00155d831300, transportConnection=org.apache.activemq.artemis.core.remoting.impl.netty.NettyServerConnection@417b6fef[ID=6280c69f, local= /127.0.0.1:61616, remote=/127.0.0.1:1125]], true, true, false, false, null, org.apache.activemq.artemis.core.protocol.core.impl.CoreSessionCallback@103d417f, true, OperationContextImpl [61828916] [minimalStore=9223372036854775807, storeLineUp=0, stored=0, minimalReplicated=9223372036854775807, replicationLineUp=0, replicated=0, paged=0, minimalPage=9223372036854775807, pageLineUp=0, errorCode=-1, errorMessage=null, executorsPending=0, executor=OrderedExecutor(tasks=[])], {}]]
2021-10-04 14:14:04,864 [AUDIT](Thread-7 (ActiveMQ-server-org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl$6@b62d79)) AMQ601500: User admin(admins)@127.0.0.1:1125 is sending a message CoreMessage[messageID=528267,durable=true,userID=3b146a62-24ef-11ec-aa52-00155d831300,priority=4, timestamp=Mon Oct 04 14:14:04 IST 2021,expiration=0, durable=true, address=jms.topic.server.weatherForecast,size=314,properties=TypedProperties[__AMQ_CID=3b13ce1f-24ef-11ec-aa52-00155d831300]]@1994364957, with Context: RoutingContextImpl(Address=null, routingType=null, PreviousAddress=null previousRoute:null, reusable=null, version=0)
..................................................

2021-10-04 14:14:04,865 [AUDIT](Thread-7 (ActiveMQ-server-org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl$6@b62d79)) AMQ601501: User admin(admins)@127.0.0.1:1110 is consuming a message from 41207748-6ed3-42d2-b75e-044805212686: Reference[528267]:RELIABLE:CoreMessage[messageID=528267,durable=true,userID=3b146a62-24ef-11ec-aa52-00155d831300,priority=4, timestamp=Mon Oct 04 14:14:04 IST 2021,expiration=0, durable=true, address=jms.topic.server.weatherForecast,size=314,properties=TypedProperties[__AMQ_CID=3b13ce1f-24ef-11ec-aa52-00155d831300]]@1994364957
2021-10-04 14:14:04,868 [AUDIT](Thread-4 (ActiveMQ-server-org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl$6@b62d79)) AMQ601502: User admin(admins)@127.0.0.1:1110 is acknowledging a message from 41207748-6ed3-42d2-b75e-044805212686: CoreMessage[messageID=528267,durable=true,userID=3b146a62-24ef-11ec-aa52-00155d831300,priority=4, timestamp=Mon Oct 04 14:14:04 IST 2021,expiration=0, durable=true, address=jms.topic.server.weatherForecast,size=314,properties=TypedProperties[__AMQ_CID=3b13ce1f-24ef-11ec-aa52-00155d831300]]@1994364957
2021-10-04 14:14:08,059 [AUDIT](Thread-8 (ActiveMQ-server-org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl$6@b62d79)) AMQ601500: User admin(admins)@127.0.0.1:1110 is sending a message CoreMessage[messageID=528349,durable=true,userID=3cfc1623-24ef-11ec-aa52-00155d831300,priority=4, timestamp=Mon Oct 04 14:14:08 IST 2021,expiration=0, durable=true, address=null,size=190,properties=TypedProperties[__AMQ_CID=d04d0e87-24ee-11ec-aa52-00155d831300]]@600964226, with Context: RoutingContextImpl(Address=jms.topic.AMEBAA000105.device.weatherForecast, routingType=null, PreviousAddress=jms.topic.AMEBAA000105.device.weatherForecast previousRoute:null, reusable=null, version=0)
..................................................

使用MQTT.fx時(shí)的日志如下。最初訂閱AMEBAA000105.device.weatherForecast,然后向server.weatherForecast發(fā)送消息。本來(lái)要接收這些消息的Spring Boot客戶端不會(huì)接收任何內(nèi)容,因此不會(huì)向AMEBAA000105.device.weatherForecast發(fā)送任何內(nèi)容。當(dāng)另一個(gè)Spring Boot客戶端觸發(fā)將消息從Spring Boot客戶端發(fā)布到AMEBAA000105.device.weatherForecast時(shí),MQTT.fx不捕獲該消息。

2021-10-04 14:24:35,443 [AUDIT](Thread-17 (ActiveMQ-server-org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl$6@b62d79)) AMQ601265: User admin(admins)@192.168.0.107:18640 is creating a core consumer on target resource ServerSessionImpl() [with parameters: [534062, MQTT_FX_Client.AMEBAA000105.device.weatherForecast, null, 0, false, false, -1]]
2021-10-04 14:24:43,719 [AUDIT](Thread-10 (ActiveMQ-server-org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl$6@b62d79)) AMQ601500: User admin(admins)@192.168.0.107:18640 is sending a message CoreMessage[messageID=534380,durable=false,userID=null,priority=0, timestamp=0,expiration=0, durable=false, address=server.weatherForecast,size=200,properties=TypedProperties[mqtt.message.retain=false,mqtt.qos.level=0]]@1214406991, with Context: RoutingContextImpl(Address=server.weatherForecast, routingType=null, PreviousAddress=null previousRoute:null, reusable=null, version=0)

以上日志為審核日志。在artemis.log文件中,MQTT.fx不斷ping代理。

2021-10-04 14:30:43,727 TRACE [org.apache.activemq.artemis.core.protocol.mqtt] MQTT(MQTT_FX_Client): OUT >> PINGRESP
2021-10-04 14:31:43,728 TRACE [org.apache.activemq.artemis.core.protocol.mqtt] MQTT(MQTT_FX_Client): OUT >> PINGRESP
2021-10-04 14:32:43,729 TRACE [org.apache.activemq.artemis.core.protocol.mqtt] MQTT(MQTT_FX_Client): OUT >> PINGRESP
2021-10-04 14:33:43,731 TRACE [org.apache.activemq.artemis.core.protocol.mqtt] MQTT(MQTT_FX_Client): OUT >> PINGRESP
2021-10-04 14:34:43,732 TRACE [org.apache.activemq.artemis.core.protocol.mqtt] MQTT(MQTT_FX_Client): OUT >> PINGRESP
2021-10-04 14:35:43,733 TRACE [org.apache.activemq.artemis.core.protocol.mqtt] MQTT(MQTT_FX_Client): OUT >> PINGRESP

artemis.log文件中的MQTT.fx訂閱或發(fā)布的日志如下

2021-10-04 14:22:27,702 TRACE [org.apache.activemq.artemis.core.protocol.mqtt] MQTT(MQTT_FX_Client): IN << SUBSCRIBE(3)
AMEBAA000105.device.weatherForecast : AT_MOST_ONCE
2021-10-04 14:24:43,718 TRACE [org.apache.activemq.artemis.core.protocol.mqtt] MQTT(MQTT_FX_Client): IN << PUBLISH(-1) topic=server.weatherForecast, qos=AT_MOST_ONCE, retain=false, dup=false, payload={"serialNumber" : "AMEBAA000105"}

非常感謝您的幫助。

推薦答案

您說(shuō)在測(cè)試Spring Boot客戶端時(shí),您會(huì)向server.weatherForecast發(fā)送一條消息,經(jīng)過(guò)一些處理后,會(huì)向AMEBAA000105.device.weatherForecast發(fā)送一個(gè)響應(yīng)。然而,這是而不是日志顯示的。日志顯示您分別向jms.topic.server.weatherForecastjms.topic.AMEBAA000105.device.weatherForecast發(fā)送消息。請(qǐng)注意jms.topic.前綴。

我相信這是問(wèn)題的根源,因?yàn)楦鶕?jù)日志,MQTT實(shí)際上將使用server.weatherForecastAMEBAA000105.device.weatherForecast。由于這兩個(gè)客戶端沒(méi)有使用匹配的名稱(chēng),因此它們永遠(yuǎn)不能與您的當(dāng)前配置一起工作。

我的猜測(cè)是您正在使用來(lái)自您的Spring Boot應(yīng)用程序的遺留Artemis 1.x客戶端,這就是使用jms.topic.前綴的原因。您應(yīng)該遷移到較新的客戶端(例如,與您正在使用的代理版本匹配的客戶端),或者配置anycastPrefixmulticastPrefix以支持舊版1.x客戶端。默認(rèn)的broker.xml有一個(gè)說(shuō)明如何執(zhí)行此操作的注釋?zhuān)?/p>

<!-- Note: If an acceptor needs to be compatible with HornetQ and/or Artemis 1.x clients add
           "anycastPrefix=jms.queue.;multicastPrefix=jms.topic." to the acceptor url.
           See https://issues.apache.org/jira/browse/ARTEMIS-1644 for more information. -->

默認(rèn)情況下,此注釋顯示在acceptors塊中,但似乎已將其刪除,因?yàn)樗辉谀迟N的XML中。

如果要確認(rèn)客戶端正在使用哪個(gè)庫(kù),最簡(jiǎn)單的方法就是檢查客戶端的環(huán)境。但是,如果這不起作用,并且您有權(quán)訪問(wèn)代理日志,那么您可以對(duì)org.apache.activemq.artemis.core.protocol.core.impl.RemotingConnectionImpl執(zhí)行enable TRACE logging,然后查看CreateSessionMessage中傳遞的version。如果是&lt;131,則它不是2.18.0客戶端。

這篇關(guān)于客戶端工具M(jìn)QTT.fx上定義的主題未使用ActiveMQ Artemis消息的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,

分享到:
標(biāo)簽:fx MQTT 主題 定義 客戶端 工具 消息
用戶無(wú)頭像

網(wǎng)友整理

注冊(cè)時(shí)間:

網(wǎng)站:5 個(gè)   小程序:0 個(gè)  文章:12 篇

  • 51998

    網(wǎng)站

  • 12

    小程序

  • 1030137

    文章

  • 747

    會(huì)員

趕快注冊(cè)賬號(hào),推廣您的網(wǎng)站吧!
最新入駐小程序

數(shù)獨(dú)大挑戰(zhàn)2018-06-03

數(shù)獨(dú)一種數(shù)學(xué)游戲,玩家需要根據(jù)9

答題星2018-06-03

您可以通過(guò)答題星輕松地創(chuàng)建試卷

全階人生考試2018-06-03

各種考試題,題庫(kù),初中,高中,大學(xué)四六

運(yùn)動(dòng)步數(shù)有氧達(dá)人2018-06-03

記錄運(yùn)動(dòng)步數(shù),積累氧氣值。還可偷

每日養(yǎng)生app2018-06-03

每日養(yǎng)生,天天健康

體育訓(xùn)練成績(jī)?cè)u(píng)定2018-06-03

通用課目體育訓(xùn)練成績(jī)?cè)u(píng)定