Skip to content

Commit

Permalink
revert change to queue methods (#87)
Browse files Browse the repository at this point in the history
* revert change to queue methods

* claim channel is never queue

* test
  • Loading branch information
paulwe authored Mar 11, 2024
1 parent 459d697 commit 9926ccc
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
5 changes: 4 additions & 1 deletion internal/bus/serialization.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@ func deserializeChannel(b []byte) (string, error) {

func deserialize(b []byte) (proto.Message, error) {
a := &anypb.Any{}
err := proto.Unmarshal(b, a)
opt := proto.UnmarshalOptions{
DiscardUnknown: true,
}
err := opt.Unmarshal(b, a)
if err != nil {
return nil, err
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/info/channels.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ func (i *RequestInfo) GetHandlerKey() string {
func (i *RequestInfo) GetClaimResponseChannel() bus.Channel {
return bus.Channel{
Legacy: formatChannel('|', i.Service, i.Method, i.Topic, "RCLAIM"),
Server: formatServerChannel(i.Service, i.Topic, i.Queue),
Server: formatServerChannel(i.Service, i.Topic, false),
Local: formatLocalChannel(i.Method, "RCLAIM"),
}
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/info/channels_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ func TestChannelFormatters(t *testing.T) {
require.Equal(t, "SRV.foo.a.b.c.Q", i.GetRPCChannel().Server)
require.Equal(t, "bar.REQ", i.GetRPCChannel().Local)
require.Equal(t, "foo|bar|a|b|c|RCLAIM", i.GetClaimResponseChannel().Legacy)
require.Equal(t, "SRV.foo.a.b.c.Q", i.GetClaimResponseChannel().Server)
require.Equal(t, "SRV.foo.a.b.c", i.GetClaimResponseChannel().Server)
require.Equal(t, "bar.RCLAIM", i.GetClaimResponseChannel().Local)
require.Equal(t, "foo|bar|a|b|c|STR", i.GetStreamServerChannel().Legacy)
require.Equal(t, "SRV.foo.a.b.c", i.GetStreamServerChannel().Server)
Expand Down
5 changes: 2 additions & 3 deletions pkg/info/info.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,8 @@ func (s *ServiceDefinition) RegisterMethod(name string, affinityEnabled, multi,
s.Methods.Store(name, &MethodInfo{
AffinityEnabled: affinityEnabled,
Multi: multi,
// TODO: move queue check to generator
RequireClaim: requireClaim && !queue,
Queue: queue,
RequireClaim: requireClaim,
Queue: queue,
})
}

Expand Down

0 comments on commit 9926ccc

Please sign in to comment.