linagora / james-project

Mirror of Apache James Project
Apache License 2.0
71 stars 63 forks source link

AmqpForwardAttribute mailet support declare exchange type #5275

Open vttranlina opened 1 day ago

vttranlina commented 1 day ago

Right now it using direct by default We can provide the configurable for it by init parameter exchange_type

chibenwa commented 1 day ago

exchangeType to match syntax

We should make it optional default to direct to prevent bracking change

All places in LNG environment should BTW specify it as fanout for OpenPaaS exchanges:

vttranlina commented 1 day ago

@chibenwa How about if we check if the exchange exists (created manually before); if it does, we won't need to recreate it, even if the exchange type doesn't match?

chibenwa commented 1 day ago

@chibenwa How about if we check if the exchange exists (created manually before); if it does, we won't need to recreate it, even if the exchange type doesn't match?

What's the driver API for this?

chibenwa commented 1 day ago

Problem is we can only declare.

In case of type mismatch the whole connection shutdowns...

At least from what I remember...

vttranlina commented 1 day ago

reactor.rabbitmq have not api for it, I'm thinking to com.rabbitmq.client or handle exception But it looks complex hmm, ignore it, let's keep it simple.

vttranlina commented 1 day ago

exchangeType to match syntax

not sure, we currently have routing_key (snake_cake) https://github.com/apache/james-project/blob/master/mailet/amqp/src/main/java/org/apache/james/transport/mailets/AmqpForwardAttribute.java#L99

vttranlina commented 1 day ago

James pr: https://github.com/apache/james-project/pull/2412

vttranlina commented 19 hours ago

When trying upgrade to MU I got an another error:

(reply-code=406, reply-text=PRECONDITION_FAILED - inequivalent arg 'durable' for exchange 'james:events' in vhost '/': received 'false' but current is 'true'

If now we have a one more mailet parameter, It may cause another error related to another argument.

vttranlina commented 18 hours ago

Pr to resolve this issue: https://github.com/apache/james-project/pull/2414/files