Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

golint fixes into master #154

Merged
merged 30 commits into from
Sep 1, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
f617e04
add handler metrics to bus and saga (#101)
danielwitz Jul 22, 2019
00177c9
dead letter handler should reject messages on failures and rollbacks …
Jul 22, 2019
403cd5e
return an error from the saga store when deleting a saga if saga can …
Aug 4, 2019
d84bc71
Persisted timeouts (#107)
Aug 4, 2019
858d962
Enable returning a message back from the dead to the queue (#112)
Aug 7, 2019
2b4ea92
added metric report on saga timeout (#114)
Aug 9, 2019
459fd66
Added documentation for grabbit metrics (#117)
Aug 9, 2019
e80bb49
fixing goreportcard issues (#118)
Aug 9, 2019
dc0a331
removed logging a warning when worker message channel returns an erro…
Aug 9, 2019
de202b1
corrected saga metrics name and added to metrics documentation (#119)
Aug 11, 2019
5b6de51
removed non transactional bus mode (#120)
Aug 14, 2019
d4170d6
remove fields
Aug 15, 2019
65aaf60
remove fields
Aug 15, 2019
82eb197
Merge pull request #123 from wework/fix_logs_structure
Aug 15, 2019
d5d04b9
go fmt and go lint error fixes to improve goreportcard (#126)
Aug 18, 2019
2b91211
cunsume the messages channel via ranging over the channel to prevent …
Aug 18, 2019
4337e55
Migrations functionality (#111)
Aug 18, 2019
4c1c812
sanitize migrations table name (#130)
Aug 18, 2019
6c2a9e6
more linting fixes for goreportcard (#129)
Aug 18, 2019
58b7cec
added metrics on deadLetterHandler, refactored HandleDeadLetter inter…
yuvmendel Aug 18, 2019
a916269
align migrations table name with grabbit convention (#140)
Aug 25, 2019
b4d07df
Improved tracing and added documentation (#142)
Aug 25, 2019
488c31a
Support handling raw message (#138)
Aug 25, 2019
ae08ff0
added call to worker.span.Finish() when exiting processMessage (#145)
Aug 26, 2019
4ad01a1
bug fix - when a deadletterhandler panics grabbit fails to reject the…
Aug 26, 2019
eef69fb
calling channel.Cancel when worker is stopped (#149)
Aug 28, 2019
e1ac9dc
Handle empty body messages (#147)
Aug 31, 2019
2c0a897
fixing golint warnings from goreport card (#150)
Sep 1, 2019
fa87818
more golint fixes (#152)
Sep 1, 2019
b54e818
Merge branch 'master' into v1.x
Sep 1, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 14 additions & 16 deletions gbus/abstractions.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,25 +138,23 @@ type Deadlettering interface {
ReturnDeadToQueue(ctx context.Context, publishing *amqp.Publishing) error
}

/*
RawMessageHandling provides the ability to consume and send raq amqp messages with the transactional guarantees
that the bus provides
*/

//RawMessageHandling provides the ability to consume and send raq amqp messages with the transactional guarantees that the bus provides
type RawMessageHandling interface {
/*
SetGlobalRawMessageHandler registers a handler that gets called for each amqp.Delivery that is delivered
to the service queue.
The handler will get called with a scoped transaction that is a different transaction than the ones that
regular message handlers are scoped by as we want the RawMessage handler to get executed even if the amqp.Delivery
can not be serialized by the bus to one of the registered schemas

In case a bus has both a raw message handler and regular ones the bus will first call the raw message handler
and afterward will call any registered message handlers.
if the global raw handler returns an error the message gets rejected and any additional
handlers will not be called.
You should not use the global raw message handler to drive business logic as it breaks the local transactivity
guarantees grabbit provides and should only be used in specialized cases.
If you do decide to use this feature try not shooting yourself in the foot.
        to the service queue.
        The handler will get called with a scoped transaction that is a different transaction than the ones that
        regular message handlers are scoped by as we want the RawMessage handler to get executed even if the amqp.Delivery
        can not be serialized by the bus to one of the registered schemas

        In case a bus has both a raw message handler and regular ones the bus will first call the raw message handler
        and afterward will call any registered message handlers.
        if the global raw handler returns an error the message gets rejected and any additional
        handlers will not be called.
        You should not use the global raw message handler to drive business logic as it breaks the local transactivity
        guarantees grabbit provides and should only be used in specialized cases.
        If you do decide to use this feature try not shooting yourself in the foot.
*/
SetGlobalRawMessageHandler(handler RawMessageHandler)
}
Expand Down
3 changes: 2 additions & 1 deletion gbus/bus.go
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,8 @@ func (b *DefaultBus) HandleDeadletter(handler RawMessageHandler) {
b.registerDeadLetterHandler(handler)
}

//HandleDeadletter implements RawMessageHandling.SetGlobalRawMessageHandler

//SetGlobalRawMessageHandler implements RawMessageHandling.SetGlobalRawMessageHandler
func (b *DefaultBus) SetGlobalRawMessageHandler(handler RawMessageHandler) {
metrics.AddHandlerMetrics(handler.Name())
b.globalRawHandler = handler
Expand Down
3 changes: 2 additions & 1 deletion gbus/saga/instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ func (si *Instance) invoke(exchange, routingKey string, invocation *sagaInvocati
}).Info("invoking method on saga")

span, sctx := opentracing.StartSpanFromContext(invocation.Ctx(), methodName)
// replace the original context with the conext built arround the span so we ca

// replace the original context with the conext built around the span so we ca
// trace the saga handler that is invoked
invocation.ctx = sctx

Expand Down
3 changes: 2 additions & 1 deletion tests/testMessages.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ var _ gbus.Message = &Reply2{}
var _ gbus.Message = &Event1{}
var _ gbus.Message = &Event2{}

//PoisonMessage is a malformed message to test posion pill scenarios

//PoisonMessage is a malformed message to test poison pill scenarios
type PoisonMessage struct {
}

Expand Down