We'd like to make it easier to have a more flexible strategy for
retrying message sending (e.g. retry only on some errors
or for a message-dependant time), so remove
the retry logic from felice, leaving it up to the caller
to determine.
This means that we need to pass the Context to the handler
(so that a retrying handler can know when to abort when the
context is done) and also enough information that appropriate
metrics can be sent.
Doing this means we can also simplify the configuration, because
we don't need to log or send metrics here any more (that can
be done in handler wrappers themselves).
We also a address couple of issues in the existing implementation:
there is currently a race between Serve and Stop - Serve needs to
be called in its own goroutine, so there's a race between setting
Consumer.consumer and Stop calling Consumer.consumer.Close.
Return.Errors is set to true, but there's nothing that reads from the errors channel, which makes that pointless.
All the other types use Close instead of Stop, so we rename Stop to Close accordingly.
Don't require the full config for creating a MessageConverterV1.
We'd like to make it easier to have a more flexible strategy for retrying message sending (e.g. retry only on some errors or for a message-dependant time), so remove the retry logic from felice, leaving it up to the caller to determine.
This means that we need to pass the Context to the handler (so that a retrying handler can know when to abort when the context is done) and also enough information that appropriate metrics can be sent.
Doing this means we can also simplify the configuration, because we don't need to log or send metrics here any more (that can be done in handler wrappers themselves).
We also a address couple of issues in the existing implementation:
Fixes issue #50.