Created
August 7, 2010 13:14
-
-
Save qmx/512802 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Hashtable env = new Hashtable(); | |
env.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory"); | |
env.put(Context.PROVIDER_URL, "192.168.144.17:1099"); | |
InitialContext ic = new InitialContext(env); | |
TopicConnectionFactory topicConnectionFactory = (TopicConnectionFactory) ic.lookup("ConnectionFactory"); | |
TopicConnection topicConnection = topicConnectionFactory.createTopicConnection(); | |
TopicSession topicSession = topicConnection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE); | |
TextMessage textMessage = topicSession.createTextMessage(); | |
textMessage.setText("dolar: " +new Random().nextDouble()+""); | |
Topic topic = (Topic) ic.lookup("topic/testTopic"); | |
TopicPublisher topicPublisher = topicSession.createPublisher(topic); | |
topicPublisher.publish(textMessage); | |
System.out.println("Foi"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<mbean code="org.jboss.jms.jndi.JMSProviderLoader" | |
name="jboss.mq:service=JMSProviderLoader,name=RemoteJMSProvider,server=remotehost"> | |
<attribute name="ProviderName">RemoteJMSProvider</attribute> | |
<attribute name="ProviderAdapterClass">org.jboss.jms.jndi.JNDIProviderAdapter</attribute> | |
<!-- The connection factory --> | |
<attribute name="FactoryRef">UIL2XAConnectionFactory</attribute> | |
<!-- The queue connection factory --> | |
<attribute name="QueueFactoryRef">UIL2XAConnectionFactory</attribute> | |
<!-- The topic factory --> | |
<attribute name="TopicFactoryRef">UIL2XAConnectionFactory</attribute> | |
<!-- Connect to JNDI on the host "the-remote-host-name" port 1099--> | |
<attribute name="Properties"> | |
java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory | |
java.naming.factory.url.pkgs=org.jnp.interfaces | |
java.naming.provider.url=192.168.144.17:1099 | |
</attribute> | |
</mbean> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@ActivationConfigProperty(propertyName="providerAdapterJNDI", propertyValue="java:/RemoteJMSProvider") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment