我使用嵌入式代理ActiveMq并从JavaScript应用程序连接到它。使用的协议是WebSocket上的STOMP。 Spring的XML配置:
<amq:broker id="broker" useJmx="false" persistent="false" brokerId="1" brokerName="locHost">
<amq:transportConnectors>
<amq:transportConnector name="websocket" uri="ws://0.0.0.0:6661"/>
</amq:transportConnectors>
</amq:broker>
<!-- JMS ConnectionFactory to use, configuring the embedded broker using XML -->
<amq:connectionFactory id="jmsFactory" brokerURL="vm://localhost"/>
<bean id="jmsConnectionFactory"
class="org.springframework.jms.connection.SingleConnectionFactory"
depends-on="broker"
p:targetConnectionFactory-ref="jmsFactory"
/>
<jms:listener-container
container-type="default"
connection-factory="jmsConnectionFactory"
>
. . . . .
<jms:listener destination="toggle" ref="consumer" method="toggle" response-destination="toggle"/>
. . . . .
</jms:listener-container>
还有一些这种形式的听众(其中一个):
@Component
public class Consumer {
. . . . .
public String toggle(String message) {
return "Responce" + message;
}
. . . . .
}
有些听众正在工作,但有些人有异常类型:
09:33:25,196 WARN [Transport:203] Transport Connection to: StompSocket_1661562307 failed: java.io.IOException: closedOut 1006:null
并且邮件未送达收件人。我们能做什么?
答案 0 :(得分:0)
您正在运行哪个版本的AMQ?
您是否尝试过使用stomp格式的网址:
<transportConnectors>
<transportConnector name="stomp" uri="stomp://localhost:61613"/>
</transportConnectors>
网址以stomp://