-
Notifications
You must be signed in to change notification settings - Fork 132
Description
I'm experiencing an issue where I am trying to configure and start two river clients that belong to two separate applications that are each configured with separate worker bundles (and separate queues) that point to the same database/schema where each application CAN (as part of being the elected leader), insert jobs to be worked by the OTHER application/client.
- application A embeds client A which contains workers A and C
- application B embeds client B which contains workers, B and C
Where C represents a shared, periodic job that both clients can work in which C's Work() method inserts jobs for both A and B. Because of river's election system, only one client is the leader at any given point in time. This means client A will be inserting B jobs and client B will be inserting A jobs.
I would expect the A and B clients to be notified of the respective jobs that they are configured to work. How is this that much different from an insert-only client able to Insert jobs that are not configured as part of its own worker bundle?
Is this potentially something that could be changed where the validateJobArgs function invocation is removed? Does this have any side-effects/implications with River's internals?
EDIT: I just tried to have each client's C Work() method use an insert-only River client. This works and allows the insertion of jobs which are not configured to be worked by the application's "main" river client. However, the "main" river client A still picks up jobs for worker B and the worker then fails with the same error message: "job kind is not registered in the client's Workers bundle". I guess, more generally, am I thinking about this wrong? Is it possible to do what I'm trying to do?
If I run both clients simultaneous, it seems that each client evenly split up the jobs when they become available which results in ½ of the jobs being worked by the correct client/worker while the other ½ are worked by the "wrong" client and continue to fail for the reason above.