There are endless resources on creating CRUD for REST resources but I can’t find much on doing the same for Messaging.
Given two services A
and B
where A
receives incoming requests that initiates the creation of the resource R
. When A
receives the request it does some processing and creates R
and then wants to store R
in B
using JMS. After creation, the Read/Update/Delete operations should be available on R
.
I can see a couple of different approaches here:
-
Use a generic entity that contains an
operation
(crud) and some generic object that can be cast toR
if updating, and toid(R)
if reading or deleting. The entity is published on a common queueQ
. -
Use strictly typed entities for the different operations where each operation is published on its own queue
Qc, Qr, Qu, Qd
. -
Use strictly typed entities for the different operations where each operation is published on the same queue
Q
but with differenttype
.
From my understanding of JMS it is usually recommended to use separate queues for different types of messages to avoid congestion-issues where one type of message can block for all others.
Does this mean the CRUD operations should have separate queues or should they be considered to handle the same type of resource and thus share a queue?