javax.jms.JMSException: Failed to create session factory while sending message to embedded ActiveMQ Artemis within JBoss EAP 7.2

前端 未结 1 535
萌比男神i
萌比男神i 2021-01-27 06:53

I am trying to develop a program that will send message to ActiveMQ Artemis embedded in JBoss EAP 7.2. I have followed the instructions given in this question:

Below is

1条回答
  •  长情又很酷
    2021-01-27 07:27

    When you use the -b switch on the command-line when starting the server that means all the socket-bindings in your socket-binding-group will be bound to that IP address by default.

    Your JMS client is looking up jms/RemoteConnectionFactory. Here's the configuration for that connection-factory:

    
    

    This connection-factory is using the http-connector. Here's the config for the http-connector:

    
    

    This is using the http socket-binding which is using the internal IP address since you're using the -b switch on the command-line when starting the server. Therefore when your remote JMS client looks up jms/RemoteConnectionFactory it will get a connection factory pointing to the internal IP address which will fail.

    To resolve this issue you need to configure RemoteConnectionFactory to use the external IP address.

    First, define a new interface, e.g.:

    
        
    
    

    You can configure the actual external IP address here or you can pass it on the command-line using -Djboss.bind.address.external=<>.

    Second, define a new socket-binding to use this interface:

    
    

    Third, define a new http-connector to use this socket-binding:

    
    

    Fourth, change RemoteConnectionFactory to use this http-connector:

    
    

    0 讨论(0)
提交回复
热议问题