The Service
Public Class GetContactConsumer
Implements Consumes(Of Schema.KlantService.IGetContactV1).Context
Public Sub Consume(message As IConsumeContext(Of Schema.KlantService.IGetContactRequestV1)) Implements MassTransit.Consumes(Of IConsumeContext(Of Schema.KlantService.IGetContactRequestV1)).All.Consume
HandleMessageAsync(message)
End Sub
Private Async Sub HandleMessageAsync(context As IConsumeContext(Of Schema.KlantService.IGetContactPersonenRequestV1))
Dim Id = context.Message.Id
Dim contacten = Await New ContactPersonenController().GetContactPersonen(Id)
Dim response As New GetContactResponseV1
response.Contacten = contacten
context.Respond(response)
End Sub
End Class
MassTransit supports request reply mechanisms, but what bothers me is that the design of the responder depends on it. I have setup this service to support RR, however if I would like to send something from another service (using the normal event based practice). Using this setup in combination with a consumer for the response, the response will end up in the error queue.
My guess is that this is because the lack of ACK that was sent from my consumer. Is there any way that I can use request reply in eg an MVC application, but use regular events for service-to-service communication?