Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jul 20th, 2012  |  syntax: None  |  size: 0.70 KB  |  hits: 15  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Here's the torquebox.yml:
  2.  
  3. web:
  4.   context: /tbmsg
  5.   static: public
  6.   env: development
  7.  
  8. tasks:
  9.   send_msg:
  10.  
  11. jobs:
  12.   send_msg:
  13.     job: SendMsg
  14.     cron: '*/5 * * * * ?'
  15.  
  16. queues:
  17.   /queues/msgq:
  18.     durable: true
  19.  
  20. topics:
  21.   /topics/msg_topic:
  22.     durable: true
  23.  
  24. Here's the job: send_msg.rb
  25.  
  26. class SendMsg
  27.   def run
  28.     #logger.debug "This is a send_msg debug entry"
  29.     queue = TorqueBox::Messaging::Queue.new('/queue/msgq')
  30.     queue.publish Time.now
  31.   end
  32. end
  33.  
  34. Here's the error:
  35.  
  36. 19:32:20,937 ERROR [org.quartz.core.JobRunShell] Job tbmsg.send_msg threw an unhandled Exception: : org.jruby.exceptions.RaiseException: (NativeException) javax.naming.NameNotFoundException: msgq not bound