Pass the Parameters

Aug 14, 2014 at 9:38 AM
Hi,how are you?

I have use the shuttle to my project.
Now I met some problem.I want to ask a Entity thing.
In the demo,we use OrderCompletedEvent and WorkDoneEvent.When I make a little change,there are some problem.

First ,I want to know:in class file OrderCompletedEvent.cs,the meaning of the OrderId.
Do it relate to Serialization thing?
When I delete this field,It can still run and have no any wrong messages.
namespace PublishSubscribe.Messages
  public class OrderCompletedEvent 
     public Guid OrderId { get; set; }

      public String coment { get; set; }

Second,I want to pass "List" type in my project instead of Entity,But it will send me the wrong message about: Serialization
Aug 14, 2014 at 11:33 AM

The first thing to remember is that the messages should not be entities or any domain object, for that matter. It is always a simple DTO (data transfer object). It should contain the relevant data that you need and the relevant entity ids.

Next you need to remember to be careful with message versions. Changing existing message structures may result in failures. If you do want to change a structure use another name or namespace. A namespace should be easier. If you are in development and versioning is not yet an issue (as it would be in production) then you could make a breaking change but you would need to remember to purge all message from the relevant queues.

Shuttle does not do anything special w.r.t. serialization so if it breaks it means that the structure is not compatible.

If you want to consider a namespace mechanism you could go with something like this:
namespace Company.BC.Messages.V1
As soon as you encounter breaking changes you could have that message under:
namespace Company.BC.Messages.V1
However, things get rather tricky when it comes to subscriptions and the like so these things need to be carefully considered.