0

implementing service bus with servicestack and rabbitmq here.

Documentation states "each message will instead be executed by the best matching ServiceStack Service that handles the message with either a Post or Any fallback verb".

How then would I make the published message from the client route to PUT?

Thanks in advance for any suggestions or samples.

1 Answers1

0

each message will instead be executed by the best matching ServiceStack Service that handles the message with either a Post or Any fallback verb"

This documentation says that messages are treated as POST requests, as such can only be handled with Post(Request) or Any(Request) handlers. This is the same as ServiceStack's SOAP Support where all SOAP request are POST's, which you can ensure is accessible by SOAP/MQ requests by maintaining separate Request DTO's (a common and recommended practice) and implementing them using Any() so they're still accessible by both PUT and POST requests, e.g:

[Route("/customers", "POST"]
public class CreateCustomer { ... }

[Route("/customers/{Id}", "PUT"]
public class UpdateCustomer { ... }

public class CustomerService : Service
{
    public object Any(CreateCustomer request) { ... }
    public object Any(UpdateCustomer request) { ... }
}

This service enables access to the service via POST /customers and PUT /customers/1 HTTP routes while still allowing them to be accessed via SOAP/MQ.

Community
  • 1
  • 1
mythz
  • 141,670
  • 29
  • 246
  • 390