You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm playing around with the plugin to understand how to use it properly and to see if it suits my needs.
My goal is to build a microservice system with components talking to each other by sending messages to the queue.
Server listens to seneca_any_act topic and writes to seneca_any_res
Client listens to seneca_any_res topic and writes to seneca_any_act
We get our { result: 'pong' } response
Of course, this setup is not suitable for real usage, as each service looks for actions in the same topic. Let's change that, adding a pin option to server transport config:
So, the question is:
Do I really have to pin client like that? That seems like too much for me. Let's imagine our test microservice has not only cmd, but task, queue and some others types of actions. I would need to setup a client for each of them.
And another related question is:
In a case when we have multiple clients talking to the same server and calling the same function, they all listen to the same topic for responses. Is there a way to ensure a client gets a response that 'belongs' to its request and not some other's one? If not, is there a way to tell the server to write to different response topics (one for each client)?
The text was updated successfully, but these errors were encountered:
The pattern matching in each service should avoid the issue you are pointing to in the first example, right? We may be acknowledging the message too quickly without validating that it matches a known pattern.
I'm playing around with the plugin to understand how to use it properly and to see if it suits my needs.
My goal is to build a microservice system with components talking to each other by sending messages to the queue.
Let's start from something simple:
Which results to:
seneca_any_act
topic and writes toseneca_any_res
seneca_any_res
topic and writes toseneca_any_act
{ result: 'pong' }
responseOf course, this setup is not suitable for real usage, as each service looks for actions in the same topic. Let's change that, adding a pin option to server transport config:
And the result is:
seneca_cmd_ping_role_test__act
and writes toseneca_cmd_ping_role_test__res
seneca_any_act
and listens toseneca_any_res
Hmm, ok. Let's add a pin to client configuration as well, so it generates the same topic names as our server:
And we get somewhat unexpected result:
seneca_cmd_ping_role_test__act
/seneca_cmd_ping_role_test__res
seneca_role_test__res
/seneca_role_test__act
Ok, let's scratch our head a little and try the following setup, which finally works:
So, the question is:
Do I really have to pin client like that? That seems like too much for me. Let's imagine our
test
microservice has not onlycmd
, buttask
,queue
and some others types of actions. I would need to setup a client for each of them.And another related question is:
In a case when we have multiple clients talking to the same server and calling the same function, they all listen to the same topic for responses. Is there a way to ensure a client gets a response that 'belongs' to its request and not some other's one? If not, is there a way to tell the server to write to different response topics (one for each client)?
The text was updated successfully, but these errors were encountered: