Skip to content

When adding @Incoming and @Outgoing to the same method. It will not be registered in the SubscriberDecorator. #2912

Open
@NicklasHNissen

Description

@NicklasHNissen

In my project I have a setup that requires reading one message and then sending to another. If it fails I need to put the message on a DLQ or backout queue. But for some reason in the decorator that implements SubscriberDecorator the channel doesn't show up.

Take a look at the following.

    @Incoming(REQUEST_INCOMING_CHANNEL)
    @Outgoing(RESPONSE_OUTGOING_CHANNEL)
    public void handleSomeData(double price) {
        // process your price.
    }
@ApplicationScoped
public class ConsumedMessageDecorator implements PublisherDecorator {

    private final Map<String, AtomicLong> counters = new HashMap<>();

    @Override
    public Multi<? extends Message<?>> decorate(Multi<? extends Message<?>> publisher, String channelName,
            boolean isConnector) {
        if (channelName.contains(REQUEST_INCOMING_CHANNEL)) {
            //some code
        } else {
            return publisher;
        }
    }

    @Override
    public int getPriority() {
        return 10;
    }

    public long getMessageCount(String channel) {
        return counters.get(channel).get();
    }
}

If I have both @incoming and @Outgoing on the handleSomeData method. The channelName.contains will never be true.
But if I only have @incoming it does appear in the channelName.

This has to be a bug, but I haven't been able to figure out why.
I have currently done a workaround by using the MutinyEmitter and just sending the message directly to the Reponse queue in the handleSomeData method.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions