[
https://issues.apache.org/jira/browse/CAMEL-7908?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14199466#comment-14199466
]
Aaron Whiteside edited comment on CAMEL-7908 at 11/6/14 5:59 PM:
-----------------------------------------------------------------
Updated patch with the following additional changes:
{quote}
Changes to SjmsConsumer.createConsumer()
- Corrected usage of try {} finally {} block. Also simplies the code, no need
for null check anymore.
- Added call to DestinationCreationStrategy to create the Destination before
calling JmsObjectFactory.createMessageProducer.
- replaced 'if (isTransacted())' with ternary operator, for cleaner code.
- Better to fail hard, don't return a null resource, error out instead.
Exception will propagate back up to SjmsConsumer.doStart().
- removed null checks, because 1) JMS specification says that
connection.createSession() will return a non null value or throw an exception.
2) JMS specification says that session.createConsumer() will return a non null
value or throw an exception, and we called messageConsumer.setMessageListener()
before we check if messageConsumer is null - so that's redundant.
{quote}
was (Author: aaronjwhiteside):
Updated patch with the following additional changes:
{quote}
Changes to SjmsConsumer.createConsumer()
- Corrected usage of try {} finally {} block. Also simplies the code, no need
for null check anymore.
- replaced 'if (isTransacted())' with ternary operator, for cleaner code.
- Better to fail hard, don't return a null resource, error out instead.
Exception will propagate back up to SjmsConsumer.doStart().
- removed null checks, because 1) JMS specification says that
connection.createSession() will return a non null value or throw an exception.
2) JMS specification says that session.createConsumer() will return a non null
value or throw an exception, and we called messageConsumer.setMessageListener()
before we check if messageConsumer is null - so that's redundant.
{quote}
> Add a DestinationCreationStrategy to the SJMS component
> -------------------------------------------------------
>
> Key: CAMEL-7908
> URL: https://issues.apache.org/jira/browse/CAMEL-7908
> Project: Camel
> Issue Type: Improvement
> Components: camel-sjms
> Affects Versions: 2.14.0
> Reporter: Aaron Whiteside
> Priority: Minor
> Fix For: 2.15.0
>
> Attachments: destination_creation_strategy.patch,
> destination_creation_strategy2.patch, unnamed2.patch
>
>
> Add a DestinationCreationStrategy to the SJMS component
> JMS implementations like HornetQ do not allow dynamic queue/topic creation
> via the pure JMS API's. Extending SJMS with a DestinationCreationStrategy
> would allow one to replace the DefaultDestinationCreationStrategy with a
> provider specific one that in the case of HornetQ dynamically creates the
> queue/topic using the correct management API.
> Implementation note:
> JmsObjectFactory::createMessageProducer would be modified to supply a
> DestinationCreateionStrategy, it would then use this to obtain Destination's.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)