Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to approach testing different queues via routingKey? #1

Open
lennartblom opened this issue Feb 14, 2019 · 0 comments
Open

How to approach testing different queues via routingKey? #1

lennartblom opened this issue Feb 14, 2019 · 0 comments

Comments

@lennartblom
Copy link

lennartblom commented Feb 14, 2019

Hi Mathias,
Thank you very much for providing such a useful blogpost and test resources!

I selected your approach of the Spring Cloud Contract dependency to start testing a distributed system, which depends on a running rabbitmq.

Unfortunately my stubs create messages, which are distributed in all message consumer queues... but in the existing service-architecture I used Topic Exchanges with specified routing keys, which only forwards selected messages to the defined queue.

Is there any way to reproduce this scenario in your test cases?

My research so far:
Definition of a new header entry:

header('amqp_receivedRoutingKey': 'requested')

https://stackoverflow.com/questions/51420639/spring-cloud-contract-with-spring-amqp

But the consumer service forwards the message-stub in ALL existing queues. So I have no control to test our "contracts" properly.

Do you have a suggestion where to dive in? Or is my requirement too sophisticated?

I also found out, that the dependency version 1.2.4.RELEASE offers the functionality to include routingKeys... but after I try to use the new Version the test fails with: Caused by: java.lang.ClassNotFoundException: org.springframework.cloud.contract.verifier.converter.YamlContractConverter

@lennartblom lennartblom changed the title How to approach testing different queues? How to approach testing different queues via routingKey? Feb 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant