Particular / docs.particular.net

All content for ParticularDocs
https://docs.particular.net
Other
103 stars 301 forks source link

Pipeline - How to configure messages TimeToBeReceived #330

Closed mauroservienti closed 9 years ago

mauroservienti commented 10 years ago

Quoting Andreas:

"With the new pipeline in v4.4 you get full control over this if you want. Here is a gist that shows how to do it:

class MyTTBRStrategy:IBehavior

{
    public void Invoke(SendLogicalMessageContext context, Action next)

    {
        if (context.MessageToSend.MessageType == typeof (MyMessage))

        {
            context.MessageToSend.Metadata.TimeToBeReceived = TimeSpan.FromSeconds(10);

        }

        next();

    }
}

Full demo:

https://gist.github.com/andreasohlund/1dec391188c5d494e05b "

SimonCropp commented 10 years ago

@andreasohlund i am not sure we want to document this?? @johnsimons

mauroservienti commented 10 years ago

@dannycohen asked me to do that

andreasohlund commented 10 years ago

Lets decide after John completes the refactoring of the api?

Sent from my iPhone

On 11 May 2014, at 10:17, Simon Cropp notifications@github.com wrote:

@andreasohlund i am not sure we want to document this?? @johnsimons

— Reply to this email directly or view it on GitHub.

mauroservienti commented 10 years ago

yes, this is just a placeholder

johnsimons commented 10 years ago

:-1: to document anything to do with an unreleased/undocumented API

dannycohen commented 10 years ago

@johnsimons - Are you opposed to documenting this period, or just to documenting this before releasing ?

johnsimons commented 10 years ago

@dannycohen before releasing.

Also not sure if this is beneficial for everyone, so maybe we need to consider whether this is something that should be added to the doco. So what I'm saying is that I think that adding something to the doco site that a single user has asked in the mailing list seems to be a bit prematurely, I would consider adding this if it becomes a frequent question on the mailing list.

dannycohen commented 10 years ago

Got it. @mauroservienti - please take that into consideration.

The initial drive to docu this came from @udidahan. I agree with @johnsimons. On May 13, 2014 9:22 AM, "John Simons" notifications@github.com wrote:

@dannycohen https://github.com/dannycohen before releasing.

Also not sure if this is beneficial for everyone, so maybe we need to consider whether this is something that should be added to the doco. So what I'm saying is that I think that adding something to the doco site that a single user has asked in the mailing list seems to be a bit prematurely, I would consider adding this if it becomes a frequent question on the mailing list.

— Reply to this email directly or view it on GitHubhttps://github.com/Particular/docs.particular.net/issues/330#issuecomment-42921163 .

mauroservienti commented 10 years ago

I think that we need to understand first what is the future of the Pipeline from the end-user perspective, and only then decide how to document and what to document.

dannycohen commented 10 years ago

@mauroservienti - Agreed. I suggest you collect the info from engineering, focusing on latest changes and remaining roadmap. We can discuss this in the next support / guidance meeting as well. Can you drive this ?

mauroservienti commented 10 years ago

yes, I'll do.

mauroservienti commented 9 years ago

@johnsimons @dannycohen @andreasohlund Should we close this? As far as I can see it cannot be done anymore:

context.OutgoingLogicalMessage.Metadata.TimeToBeReceived

is readonly.

andreasohlund commented 9 years ago

Haven't tested it but you should be able to set TTBR on the sendoptions instead:

https://github.com/Particular/NServiceBus/blob/develop/src/NServiceBus.Core/Unicast/SendOptions.cs

Sent from my iPhone

On 10 Nov 2014, at 17:12, Mauro Servienti notifications@github.com wrote:

@johnsimons @dannycohen @andreasohlund Should we close this? As far as I can see it cannot be done anymore:

context.OutgoingLogicalMessage.Metadata.TimeToBeReceived

is readonly.

— Reply to this email directly or view it on GitHub.

johnsimons commented 9 years ago

This is possible to do:

        public void Invoke(OutgoingContext context, Action next)
        {
            var sendOptions = context.DeliveryOptions as SendOptions;

            if (sendOptions == null)
            {
                next();
                return;
            }
            sendOptions.TimeToBeReceived = whatever;
            next();
        }

But I still do not see a compelling story to provide this doco. Thoughts @Particular/core-developers ?

SimonCropp commented 9 years ago

considering this can be handled with code via the conventions i dont think this is a useful thing to document. perhaps @andreasohlund can add some more context as to why he thought this was valuable

andreasohlund commented 9 years ago

The only use case I can see is where TTBR needs to be dynamic depending on data in the incoming message?

I'd say close this one for now since it's going to be a non issue when we add the bus.Send overload that takes a SendOption param

Sent from my iPhone

On 10 Nov 2014, at 23:46, Simon Cropp notifications@github.com wrote:

considering this can be handled with code via the conventions i dont think this is a useful thing to document. perhaps @andreasohlund can add some more context as to why he thought this was valuable

— Reply to this email directly or view it on GitHub.

mauroservienti commented 9 years ago

:+1: closing