Skip to content

AS-5201: Include topic name in required exception - #200

Open
Rutuja-IBM wants to merge 3 commits into
masterfrom
AS-5201-include-topicName-in-exception
Open

AS-5201: Include topic name in required exception#200
Rutuja-IBM wants to merge 3 commits into
masterfrom
AS-5201-include-topicName-in-exception

Conversation

@Rutuja-IBM

Copy link
Copy Markdown
Collaborator

@Rutuja-IBM
Rutuja-IBM requested a review from heesung-sohn April 15, 2026 14:43
@Rutuja-IBM

Rutuja-IBM commented Apr 15, 2026

Copy link
Copy Markdown
Collaborator Author

As discussed in this PR: #198
I’ve implemented the changes to handle the exception as requested by the client and refined the code for better clarity.

com.datastax.oss.pulsar.jms.Utils.handleException(Utils.java:74) com.datastax.oss.pulsar.jms.PulsarConnectionFactory.getProducerForDestination(...) com.datastax.oss.pulsar.jms.PulsarSession.getProducerForDestination(PulsarSession.java:265)

The getProducerForDestination method is the appropriate place to include the topic name in the exception message.

Changes made:

  • Added topic name enrichment to exception handling where applicable.
  • Introduced an overloaded method to safely handle cases where the topic may be null.
  • Removed unrelated/unnecessary changes to keep the commit focused on this specific fix.

Do you have any other suggestions for this enrichment "[topic=" + topic + "]") ?
for ex: [topic=persistent://tenant/namespace/my-topic] it should find this regex

if (topic == null || (jms.getMessage() != null && jms.getMessage().contains("[topic=" + topic + "]"))) {
  return jms;
}

@Rutuja-IBM
Rutuja-IBM requested review from heesung-sohn and removed request for heesung-sohn April 16, 2026 06:02
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.

1 participant