Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- thufir@doge:~/groovy$
- thufir@doge:~/groovy$ groovy jms.groovy
- Caught: groovy.lang.MissingMethodException: No signature of method: static GroovyJMSExample.sendMessage() is applicable for argument types: () values: []
- Possible solutions: sendMessage()
- groovy.lang.MissingMethodException: No signature of method: static GroovyJMSExample.sendMessage() is applicable for argument types: () values: []
- Possible solutions: sendMessage()
- at GroovyJMSExample.main(jms.groovy:21)
- thufir@doge:~/groovy$
- thufir@doge:~/groovy$ cat jms.groovy
- @Grab(group='net.sf.gtools.jms', module='JmsCategory', version='0.2')
- @Grab(group='org.apache.activemq',module = 'activemq-all', version='5.9.0')
- @Grab(group="junit", module="junit", version="4.11")
- import net.sf.gtools.jms.JmsCategory
- import org.apache.activemq.ActiveMQConnectionFactory
- class GroovyJMSExample {
- def sendMessage() {
- use(JmsCategory) {
- def jms = new ActiveMQConnectionFactory('tcp://localhost:61616')
- jms.connect { c ->
- c.queue("TEST-queue") { q ->
- def msg = createTextMessage("test")
- q.send(msg)
- }
- }
- }
- }
- static void main(String[] args) {
- sendMessage()
- }
- }
- thufir@doge:~/groovy$
Advertisement
Add Comment
Please, Sign In to add comment