Torquebox , Torquespec testing queues can't be fetched in remote_describe block

StackOverflow https://stackoverflow.com/questions/17057616

  •  31-05-2022
  •  | 
  •  

Вопрос

I'm building a trigger capturing system with Torquebox and use Torquespec for TDD/BDD system manages a queue of captured triggethers and processes them. Following are the snippets of torquebox.rb config file and start_spec.rb spec file


torquebox.rb

TorqueBox.configure do

 pool :web, :type => :shared

 service TriggerTrapperService do
   config do
    name 'RTBS triggers trapper service'
   end
 end

 queue '/queues/rtbs_triggers_queue'

end

start_spec.rb

require 'torquespec'
require 'torquebox-core'
require 'spec_helper'


describe "local test" do
 deploy <<-END.gsub(/^ {4}/,'')
    application:
        root: #{File.dirname(__FILE__)}/../app
 END

 remote_describe "remote test" do
  include TorqueBox::Injectors

   it "should work" do
     some_service = fetch('/queues/rtbs_triggers_queue')
     some_service.should.equal? nil
   end
 end
end

the issue I having is when I fetch the queue rtbs_triggers_queue in the remote block it returns nil as if the in the testing environment torquebox.rb is not being read and I had the same results with the torquebox.yml as well, what could be the reason ? thanks in advance

Это было полезно?

Решение

I found that rather than using fetch get the specified queue object we need to use

TorqueBox::Messaging::Queue.new('/queues/my_queue')

Even thought this seems we are creating a new queue what it actually does is get a reference to the queue declared in the torquebox.rb

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top