Note that there are some explanatory texts on larger screens.

plurals
  1. POAccessing Grails ActiveMQ from Remote Machine
    text
    copied!<p>I am new to JMS stuff.. I read the JMS and ActiveMQ plugins documentation but still not clear with it . </p> <p>I am trying to build a system where a Grail app hosted on machine A with ActiveMQ embedded in it should be capable of sending messages. And another Grails app hosted on Machine B with just the JMS plugin should be able to receive messages and respond to it.</p> <p>After reading the documentation I created a grails App on machine A where controller sends the message to service on Machine A and it displays the message on Console. Now I am trying to implement a service with similar behavior on Machine B.</p> <p>After configuration on Machine B , my resource.groovy looks like this:</p> <pre><code> 1 2 import org.apache.activemq.ActiveMQConnectionFactory 3 import org.springframework.jms.connection.SingleConnectionFactory 4 beans = { 5 6 jmsConnectionFactory(SingleConnectionFactory) { 7 targetConnectionFactory = { ActiveMQConnectionFactory cf -&gt; 8 brokerURL = 'vm://machineA.mydomain.com' 9 } 10 } 11 } </code></pre> <p>And the service on Machine A and B look like this:</p> <pre><code>1 package replicationsiteapp 2 3 import grails.plugin.jms.* 4 5 class OnNotificationService { 6 7 8 boolean transactional = false 9 static exposes = ['jms'] 10 static destination = "topic.notify" 11 boolean isTopic = true 12 13 14 @Subscriber(topic = "topic.notify") 15 def onTopicMessage(it){ 16 17 println " YOU GOT MESSAGE FROM : $it" 18 } 19 24 } 25 </code></pre> <p>Controller on Machine A:</p> <pre><code> package hello class NotificationController { def index() { def message = "Hi, this is a Hello World with JMS &amp; ActiveMQ, " + new Date() sendTopicJMSMessage("topic.notify",message) render message } } </code></pre> <p>Machine A: Grails 2.1 on Unix with plugins installed (ActiveMQ and JMS)</p> <p>Machine B: Grails 2.1 on Unix with plugins installed (JMS)</p> <p>Current Issue:</p> <p>When message is sent from Controller on Machine A Service on Machine A displays message in console but Machine B doesnot</p> <p>Expected: Machine B should also receive the messages</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload