[Remoting] - Re: clientConnectAddress not working
by ron.sigal@jboss.com
Hi John,
The fact is that "clientConnectAddress" is used only on the server side by org.jboss.remoting.transport.transport.Connector to generate an InvokerLocator from a declarative XML configuration (e.g., an MBean). So, for example,
| <mbean code="org.jboss.remoting.transport.Connector"
| name="jboss.remoting:service=Connector,transport=Socket"
| display-name="Socket transport Connector">
|
| <attribute name="Configuration">
| <config>
| <invoker transport="socket">
| <attribute name="serverBindAddress">192.168.0.82</attribute>
| <attribute name="clientConnectAddress">216.23.33.2</attribute>
| ...
|
will cause the server to bind to 192.168.0.82 but will lead to the InvokerLocator
| socket://216.23.33.2 ...
|
It is thus that the value of "clientConnectAddress" is communicated to the client, which looks only at the address in the InvokerLocator.
The discussion in Remoting Guide must be lacking, so I've created JIRA-1142 "Clarify use of "clientConnectAddress" in RemotingGuide" to remind me to extend it.
-Ron
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4242742#4242742
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4242742
17 years
[JBoss Messaging] - Re:
by nbhatia
Hi Tim,
To answer your questions:
- I am not mixing jars from beta1/2 with beta3. I have completely separate JBoss installations for JBoss+JBM.BETA1 and JBoss+JBM.BETA3. The JBoss installations were created by running ant in JBM's config\jboss-as directory with appropriate versions installed. Also since my app runs on JBoss, my ear does not contain any JBM jars.
- I also have acceptors and connectors on my beta 3 configuration just like clebert. We had talked about that issue on a separate thread, so I am aware of it. Specifically, I have copied jboss-messaging-2.0.0.BETA3\examples\javaee\mdb\server\jbm-configuration.xml to JBOSS_HOME\server\default-with-jbm2\deploy\messaging.sar\jbm-configuration.xml.
- I tried doing a JCA configuration as you suggested, but that crashed and burned! Specifically, the ant task that generates default-with-jbm2 creates a ra.xml that is fairly close to the example in the documentation. The default jms-ds.xml also creates a tx-connection-factory with jndi-name = JmsXA. So I simply changed my jndi lookup as follows, hope that's correct:
| jndiContext = new InitialContext();
| connectionFactory = (ConnectionFactory)
| jndiContext.lookup("/JmsXA");
|
I am not sure how to configure the listener part. Following the documentation example I changed my message listener as follows:
| @MessageDriven(name = "TestMessageListener", activationConfig = {
| @ActivationConfigProperty(propertyName="destinationType", propertyValue="javax.jms.Queue"),
| @ActivationConfigProperty(propertyName="destination", propertyValue="queue/jmstest"),
| @ActivationConfigProperty(propertyName="acknowledgeMode", propertyValue="Auto-acknowledge"),
| @ActivationConfigProperty(propertyName="ConnectorClassName", propertyValue="org.jboss.messaging.integration.transports.netty.NettyConnectorFactory"),
| @ActivationConfigProperty(propertyName="ConnectionParameters", propertyValue="jbm.remoting.netty.port=5545")
| })
| public class TestMessageListener implements MessageListener {
| ...
| }
|
Of course, this doesn't work! I get the following exception:
| Caused by: MessagingException[errorCode=2 message=Unable to connect to server using configuration org-jboss-messaging-integration-transports-netty-NettyConnectorFactory?jbm-remoting-netty-port=5545]
| at org.jboss.messaging.core.client.impl.ConnectionManagerImpl.createSession(ConnectionManagerImpl.java:294)
| at org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl.createSessionInternal(ClientSessionFactoryImpl.java:962)
| at org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl.createSession(ClientSessionFactoryImpl.java:706)
| at org.jboss.messaging.ra.JBMResourceAdapter.createSession(JBMResourceAdapter.java:1261)
| at org.jboss.messaging.ra.inflow.JBMActivation.setupSession(JBMActivation.java:359)
| at org.jboss.messaging.ra.inflow.JBMActivation.setup(JBMActivation.java:306)
| at org.jboss.messaging.ra.inflow.JBMActivation.start(JBMActivation.java:269)
|
What next?
BTW, couple of questions:
1) I see that we are creating a tx-connection-factory in jms-ds.xml. Where do we create an "rx-connection-factory"? Do these have to be seperate and different?
2) Why do we have low-level details like "jbm.remoting.netty.port=5545" in annotations? Is there any way to avoid them. My earlier configuration simply had this:
| @MessageDriven(activationConfig={
| @ActivationConfigProperty(propertyName="destinationType", propertyValue="javax.jms.Queue"),
| @ActivationConfigProperty(propertyName="destination", propertyValue="queue/jmstest")
| })
|
which seems quite logical, but I don't know how it figured out which connection factory to use. I would appreciate some clarification on this.
Thanks.
Naresh
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4242736#4242736
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4242736
17 years