I have a simple service which produces some string value:
class MyService {
String foo() {
return UUID.randomUUID();
}
}
This value is then put to an activeMQ queue "integration.uuids" by some Camel route. I want this value to be attached to the http session of the currently logged in user.
What are the possible ways to achieve this?
In my web application there is another Camel route - subscriber of "integration.uuids".
However, since both the service itself and the subscriber are completely stateless (unaware of which user actually invoked MyServices)
I am a bit confused about this scenario.
So far I thought of the following changes to the architecture:
1) introducing one queue per user (problematic for application with thousands users). I think this approach ruins the stateless nature of the MyService, since it will have to know exactly which destination queue to place the value to.
2) Changing the message itself from a plain string with UUID to something like {"caller":"bob", "uuid":"uuid-uuid-uuid-uuid"} However, callers will have to supply their usernames every time they want to invoke the MyService.
Any ideas would be appreciated.