Change Publication to Event

This commit is contained in:
Asim Aslam 2019-07-07 12:44:09 +01:00 committed by Vasiliy Tolstov
parent d631074eff
commit 5cedaef171

View File

@ -167,7 +167,7 @@ func validateSubscriber(sub server.Subscriber) error {
} }
func (g *grpcServer) createSubHandler(sb *subscriber, opts server.Options) broker.Handler { func (g *grpcServer) createSubHandler(sb *subscriber, opts server.Options) broker.Handler {
return func(p broker.Publication) error { return func(p broker.Event) error {
msg := p.Message() msg := p.Message()
ct := msg.Header["Content-Type"] ct := msg.Header["Content-Type"]
if len(ct) == 0 { if len(ct) == 0 {
@ -208,7 +208,7 @@ func (g *grpcServer) createSubHandler(sb *subscriber, opts server.Options) broke
co := cf(b) co := cf(b)
defer co.Close() defer co.Close()
if err := co.ReadHeader(&codec.Message{}, codec.Publication); err != nil { if err := co.ReadHeader(&codec.Message{}, codec.Event); err != nil {
return err return err
} }