Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feature] add the ability to override the ConsumerConfiguration per Session/JMSContext #60

Merged
merged 2 commits into from
Aug 31, 2022

Conversation

eolivelli
Copy link
Collaborator

@eolivelli eolivelli commented Aug 31, 2022

Modifications

  • add JMSContext.createContext(int mode, Map<String, Object> customConfiguration)
  • add Session.createSession(int mode, Map<String, Object> customConfiguration)

In order to override the consumerConfiguration the code looks like:


Map<String, Object> properties = ...;


Map<String, Object> overriddenProperties = new HashMap<>();
Map<String, Object> overriddenConsumerConfig = new HashMap<>();
overriddenProperties.put("consumerConfig", overriddenConsumerConfig);

try (PulsarConnectionFactory factory = new PulsarConnectionFactory(properties);
      PulsarJMSContext primaryContext = factory.createContext(JMSContext.CLIENT_ACKNOWLEDGE);
      JMSContext overrideConsumerConfiguration = primaryContext.createContext(primaryContext.getSessionMode(),
                  overriddenConsumerConfig) {
       

}

The same works with the JMS 1.x API (Session)

Modifications:

  • move the Consumer configuration to a separate class
  • add the necessary methods to the APIs
  • add tests

Fixes #59 59

…ession/JMSContext

- add JMSContext.createContext(int mode, Map<String, Object> consumerConfiguration)
- add Session.createSession(int mode, Map<String, Object> consumerConfiguration)
@eolivelli eolivelli force-pushed the impl/per-consumer-config branch from cea556d to cb0c9c8 Compare August 31, 2022 12:13
@eolivelli eolivelli marked this pull request as ready for review August 31, 2022 12:21
@eolivelli eolivelli merged commit ce1d6e4 into master Aug 31, 2022
@eolivelli eolivelli deleted the impl/per-consumer-config branch August 31, 2022 14:25
sijie pushed a commit to streamnative/pulsar-jms that referenced this pull request Jul 27, 2023
…ession/JMSContext (datastax#60)

* [feature] add the ability to override the ConsumerConfiguration per Session/JMSContext
- add JMSContext.createContext(int mode, Map<String, Object> consumerConfiguration)
- add Session.createSession(int mode, Map<String, Object> consumerConfiguration)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support setting DLQ properties per Consumer and not per ConnectionFactory
2 participants