Masstransit.StructuredMap estrange behavior

11 views
Skip to first unread message

José Mavungo

unread,
Jan 14, 2018, 7:04:56 PM1/14/18
to masstransit-discuss
Hi, I am registering my consumer using the extension method like:
...

class BusRegistry: Registry {
     public BusRegistry(){
           ...
          x.ReceiveEndPoint("student_add_queue", e=> e.LoadFrom(context)
          ...
     }
}

Then if I have more than one consumer registred in the container, it will create for student_add_queue and all the consumer in the container.
It caused a lot of duplication when I published a message.

Is it the expected behavior or I am doing something wrong

Chris Patterson

unread,
Jan 16, 2018, 1:33:37 PM1/16/18
to masstrans...@googlegroups.com
Expected.

If you want to have multiple consumers and multiple endpoints, you need to create multiple child containers and manage them separately.

It's why I don't use LoadFrom, never have honestly.

I use

e.Consumer<MyConsumer>(context);

And it will resolve the consumer from the container, and manage the lifetime scope via StructureMap.



--
You received this message because you are subscribed to the Google Groups "masstransit-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to masstransit-discuss+unsub...@googlegroups.com.
To post to this group, send email to masstransit-discuss@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/masstransit-discuss/ff16b2cc-799d-490f-a7d0-aaa43f81ea58%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages