I'm trying to setup spring-cloud-contract with Active MQ Virtual topics as message system. I have a problem that virtual topic use different names for sending and receiving the message. But in contract we can define just one output channel in SendTo part of outputMessage. Does anyone know how to handle this scenario?
outputMessage { sentTo "verifications" body( ''' ''' }
Well it looks like we have something like producer and consumer variables in contract which lets us configure values at producer and consumer end.
so, doing something like
sentTo $(consumer('VirtualTopic.A'), producer('Consumer.B.VirtualTopic.A'))
will do the trick. Here We are sending to the virtual topic and receiving from the queue.
Off course we need to add correct destination in our tests while sending at producer end and receiving at consumer end. This part will do the trick for auto generated test to verify received message at producer and send message to consumer.
Hope this helps