MessageDrivenBean无法验证远程服务器上的用户

时间:2019-03-28 10:15:12

标签: java jms wildfly

我正在尝试侦听远程Wildfly服务器上的JMS队列。我已经成功连接到远程服务器以与同一用户发送消息,但是设置MessageDrivenBean时出现错误。

@MessageDriven(name = "MessageListenerBean", activationConfig = {
        @ActivationConfigProperty(propertyName = "user", propertyValue = "username"),
        @ActivationConfigProperty(propertyName = "password", propertyValue = "p@ssw0rd!"),
        @ActivationConfigProperty(propertyName = "useJNDI", propertyValue = "false"),
        @ActivationConfigProperty(propertyName = "destination", propertyValue = "/queue/receive"),
        @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue"),
        @ActivationConfigProperty(propertyName = "acknowledgeMode", propertyValue = "Auto-acknowledge"),
        @ActivationConfigProperty(propertyName="connectionParameters", propertyValue = "host=localhost;port=8080")})
public class MessageListenerBean implements MessageListener {

错误是

AMQ222216: Security problem while creating session: 
AMQ119031: Unable to validate user from invm:0. 
Username: username; SSL certificate subject DN: unavailable

我假设我的配置不正确,但是如何?

1 个答案:

答案 0 :(得分:0)

您需要在激活配置中指定正确的connectorClassName。默认值为org.apache.activemq.artemis.core.remoting.impl.invm.InVMConnectorFactory,这就是为什么它将invm连接器用于本地代理的原因。使用这个:

@ActivationConfigProperty(propertyName="connectorClassName", propertyValue = "org.apache.activemq.artemis.core.remoting.impl.netty.NettyConnectorFactory")