You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a microservice class which has its private Queue, Consumer attribute. It has a method called start running an infinite while loop calling drain_events to pool for incoming message from RabbitMq.
The Consumer has a callback method which receives an incoming message from a queue called test-queue, then publishes another message to topic called processed-message.
When I use in-memory connection in unit test, after I call start method from the microservice class, the unit test does not continue as the thread blocks at drain_events method.
How do I write unit test with a microservice running an infinite loop with drain-events?
How do I check whether there is a message published to topic processed-message when in-memory connection is used in unit test?
How do I put a message in test-queue in unit test if the microservice class does not expose Queue, Consumer attribute?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I have a microservice class which has its private Queue, Consumer attribute. It has a method called
start
running an infinite while loop callingdrain_events
to pool for incoming message from RabbitMq.The Consumer has a callback method which receives an incoming message from a queue called
test-queue
, then publishes another message to topic calledprocessed-message
.When I use in-memory connection in unit test, after I call
start
method from the microservice class, the unit test does not continue as the thread blocks atdrain_events
method.drain-events
?processed-message
when in-memory connection is used in unit test?test-queue
in unit test if the microservice class does not expose Queue, Consumer attribute?Thanks
Beta Was this translation helpful? Give feedback.
All reactions