Jboss 远程JMS队列实现

Jboss 远程JMS队列实现,jboss,jms,Jboss,Jms,你好 我只是想请求一些帮助/澄清,因为我对实现JMS是新手,我已经访问了以下链接 无法从连接到jboss-as7 hornetq的客户端创建会话工厂 [HORNETQ-952]当绑定到0.0.0.0远程HORNETQ客户端时失败-JBoss问题跟踪器 请问您如何在JBOss 7.1.1.Final上进行JMS队列远程处理 我正在连接中使用RemoteConnectionFactory 我是否需要将remote172.45.45.45 jboss服务器绑定到特定的IP地址才能远程连接到它?比如在

你好

我只是想请求一些帮助/澄清,因为我对实现JMS是新手,我已经访问了以下链接

无法从连接到jboss-as7 hornetq的客户端创建会话工厂 [HORNETQ-952]当绑定到0.0.0.0远程HORNETQ客户端时失败-JBoss问题跟踪器

请问您如何在JBOss 7.1.1.Final上进行JMS队列远程处理 我正在连接中使用RemoteConnectionFactory 我是否需要将remote172.45.45.45 jboss服务器绑定到特定的IP地址才能远程连接到它?比如在启动jboss时传递a–b IP地址? 或者像这样在standalone.conf上配置它 在远程IP/jboss/bin/standalone.conf中,我真的需要这个吗

# set this value so we can send JMS messages from remote clients
JAVA_OPTS="$JAVA_OPTS -Djboss.bind.address=172.45.45.45”
#set this value so we can send JMS messages from remote clients
JAVA_OPTS="$JAVA_OPTS -Djboss.bind.address=172.45.45.45”
#set this value so we can send JMS messages from remote clients
JAVA_OPTS="$JAVA_OPTS -Djboss.bind.address=172.45.45.45”
下面是一个场景,我想在本地笔记本电脑中将JMS消息发送到我的队列,我的队列有一个发布服务器,在172.45.45远程ip web上,war部署在该远程ip中,我将我的消费者配置到此队列

   <jms-queue name=“testqueue">
                    <entry name="java:jboss/queue/mss/testqueue"/>
                    <durable>true</durable>
                </jms-queue>
顺便说一句,我遵循了这个教程

需要有关在不使用以下配置的情况下远程实现JMS队列的帮助吗 我的本地etc/hosts配置用于该IP我真的需要这个吗? 172.45.45.45 ip-172-45-45-45.ec2.内部

远程Jboss服务器配置 在远程IP/jboss/bin/standalone.conf中,我真的需要这个吗

# set this value so we can send JMS messages from remote clients
JAVA_OPTS="$JAVA_OPTS -Djboss.bind.address=172.45.45.45”
#set this value so we can send JMS messages from remote clients
JAVA_OPTS="$JAVA_OPTS -Djboss.bind.address=172.45.45.45”
#set this value so we can send JMS messages from remote clients
JAVA_OPTS="$JAVA_OPTS -Djboss.bind.address=172.45.45.45”
以下是我的JMS发布者的代码片段

private static String username = "testuser";
private static String password = "testpass";
private static String host = "remote://172.45.45.45:4447";


Properties jndiProps = new Properties();
try {
jndiProps.put(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.naming.remote.client.InitialContextFactory");
jndiProps.put(Context.PROVIDER_URL, host);
jndiProps.put(Context.SECURITY_PRINCIPAL, username);
jndiProps.put(Context.SECURITY_CREDENTIALS, password);

Context context = new InitialContext(jndiProps);
ConnectionFactory connectionFactory = (ConnectionFactory)    context.lookup("jms/RemoteConnectionFactory");
connection = connectionFactory.createConnection(username, password);
topic = (Topic) context.lookup("jms/topic/testTopic");
System.out.println("Connected to JMS");
connection.start();
来自我的消费者的示例代码片段

/**
* Message-Driven Bean implementation class for: MDBSample- This is for Consume the Queue
*/
@MessageDriven(activationConfig = {@ActivationConfigProperty(propertyName =  "destinationType", propertyValue = "javax.jms.Queue"),
@ActivationConfigProperty(propertyName = "destination", propertyValue = "java:/queue/test"),
@ActivationConfigProperty(propertyName = "acknowledgeMode", propertyValue = "Auto-acknowledge")})
public class MessageConsumer implements MessageListener {

/**
 * Default constructor.
 */
public MessageConsumer() {

}

/**
 * @see MessageListener#onMessage(Message)
 */
public void onMessage(Message message) {

    try {
     ObjectMessage msg = (ObjectMessage) message;
     JMSMessage jmsMessage = (JMSMessage) msg.getObject();
        System.out.println("Received message is ==========> " + jmsMessage.getAction());
    } catch (JMSException e) {

        e.printStackTrace();
    }

}

}

有什么想法或建议吗?

只是为了跟进问题,我真的需要在我的etc/hostslocal计算机和我的standalone.confremote JBoss上进行配置吗?仅供将来参考,我设法解决了这个问题,通过在没有JNDI的情况下实现连接:从该实现中,我不需要配置我的etc/主机,也不需要远程绑定我的地址,您是否能够telnet您的IP 4447