quarkiverse / quarkus-ironjacamar

IronJacamar is an implementation of the Jakarta Connector Architecture specification
https://docs.quarkiverse.io/quarkus-ironjacamar/dev/index.html
Apache License 2.0
4 stars 2 forks source link

Add support for declarative ActivationSpec #2

Closed vsevel closed 1 year ago

vsevel commented 1 year ago

like in wildfly (from https://github.com/quarkusio/quarkus/issues/30943):

@MessageDriven(name = "MyMDB", activationConfig = {
    @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue"),
    @ActivationConfigProperty(propertyName = "maxSession", propertyValue = "${Messaging.maxSession:3}"),
    @ActivationConfigProperty(propertyName = "destination", propertyValue = "com/x/Messaging/MyQueue"),
    @ActivationConfigProperty(propertyName = "rebalanceConnections", propertyValue = "true") 
})
@ResourceAdapter("${MyRarName}")
public class MyMDB implements MessageListener {  
    public void onMessage(Message msg) {
        ...
    }
}

it is actually not very pretty, if going for a declaratif approach, ideally we would have a dedicated annotation for this adapter that has the properties as top level attributes, such as:

@ResourceEndpointJMS(destination="com/x/Messaging/MyQueue", ...)

Attributes should support parameterisation, such as: maxSession="${Messaging.maxSession:3}"

gastaldi commented 1 year ago

I'd prefer using MP Config for that, so you would put these in application.properties or some sort of reusable config mechanism