thufir

Untitled

Mar 9th, 2015
229
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.99 KB | None | 0 0
  1. thufir@doge:~$
  2. thufir@doge:~$ groovy IdeaProjects/groovy/src/hi.groovy
  3. org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
  4. /home/thufir/IdeaProjects/groovy/src/hi.groovy: 3: unexpected token: @ @ line 3, column 9.
  5. @Grab(group = 'org.apache.activemq', module = 'activemq-all', version = '5.9.0')
  6. ^
  7.  
  8. 1 error
  9.  
  10. thufir@doge:~$
  11. thufir@doge:~$ cat IdeaProjects/groovy/src/hi.groovy
  12. @Grapes([
  13. @Grab(group = 'net.sf.gtools.jms', module = 'JmsCategory', version = '0.2')
  14. @Grab(group = 'org.apache.activemq', module = 'activemq-all', version = '5.9.0')
  15. @Grab(group = "junit", module = "junit", version = "4.11")
  16. @Grab(group = 'net.sf.gtools.jms', module = 'JmsCategory', version = '0.2')
  17. @Grab(group = 'org.apache.activemq', module = 'activemq-all', version = '5.9.0')
  18. @Grab(group = "junit", module = "junit", version = "4.11")
  19. @Grab(group = 'net.sf.gtools.jms', module = 'JmsCategory', version = '0.2')
  20. @Grab(group = 'org.apache.activemq', module = 'activemq-all', version = '5.9.0')
  21. @Grab(group = "junit", module = "junit", version = "4.11")
  22. @Grab(group = 'net.sf.gtools.jms', module = 'JmsCategory', version = '0.2')
  23. @Grab(group = 'org.apache.activemq', module = 'activemq-all', version = '5.9.0')
  24. @Grab(group = "junit", module = "junit", version = "4.11")
  25. ])
  26. import net.sf.gtools.jms.JmsCategory
  27. import net.sf.gtools.jms.JmsCategory
  28. import org.apache.activemq.ActiveMQConnectionFactory
  29.  
  30. class GroovyJMSExample {
  31. def static sendMessage() {
  32. use(JmsCategory) {
  33. def jms = new ActiveMQConnectionFactory('tcp://localhost:3700')
  34. jms.connect { c ->
  35. c.queue("TEST-queue") { q ->
  36. def msg = createTextMessage("test")
  37. q.send(msg)
  38. }
  39. }
  40. }
  41. }
  42.  
  43. static void main(String[] args) {
  44. sendMessage()
  45. }
  46. }
  47. thufir@doge:~$
Advertisement
Add Comment
Please, Sign In to add comment