Skip to content

The replyTo must be mandatory for the RpcServer #161

@artembilan

Description

@artembilan

Describe the bug

The AmqpRpcServer has this logic:

this.publisher = this.connection.publisherBuilder().build();

So, Publisher is configured without toAddress.
Then we have this in its consumer logic:

                  Message reply = handler.handle(context, msg);
                  if (reply != null && msg.replyTo() != null) {
                    reply.to(msg.replyTo());
                  }

So, if no msg.replyTo(), then no toAddress in the end.
I guess we would fail on publishing reply, but do we really need even try?
Feels like better to fail fast here and ask for msg.replyTo() property being provided in request.

Reproduction steps

Consume requests via RpcServer when they don't have replyTo property.

Expected behavior

The RpcServer should fail fast on consumed request if that does not replyTo property.

Additional context

I might be wrong in analysis, so any clarification in the behavior would be great.
Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions