Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- thufir@doge:~$
- thufir@doge:~$ groovy IdeaProjects/groovy/src/hi.groovy
- org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
- /home/thufir/IdeaProjects/groovy/src/hi.groovy: 3: unexpected token: @ @ line 3, column 9.
- @Grab(group = 'org.apache.activemq', module = 'activemq-all', version = '5.9.0')
- ^
- 1 error
- thufir@doge:~$
- thufir@doge:~$ cat IdeaProjects/groovy/src/hi.groovy
- @Grapes([
- @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")
- @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")
- @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")
- @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 net.sf.gtools.jms.JmsCategory
- import org.apache.activemq.ActiveMQConnectionFactory
- class GroovyJMSExample {
- def static sendMessage() {
- use(JmsCategory) {
- def jms = new ActiveMQConnectionFactory('tcp://localhost:3700')
- jms.connect { c ->
- c.queue("TEST-queue") { q ->
- def msg = createTextMessage("test")
- q.send(msg)
- }
- }
- }
- }
- static void main(String[] args) {
- sendMessage()
- }
- }
- thufir@doge:~$
Advertisement
Add Comment
Please, Sign In to add comment