0

In Camel when sending to an SNS endpoint using an AmazonSNSAsync client, the publishing behavior doesn't appear to change because the underlying SnsPublisher still invokes the blocking synchronous getSNSClient().publish(request) method.

Is it possible to publish asynchronously so that the caller isn't forced to wait for the response?

The synchronous flag mentioned here might be relevant but after looking through the source code I don't see it being used.

geg
  • 4,399
  • 4
  • 34
  • 35
  • Does the SNS client have any non-block async publish method we can use? – Claus Ibsen Jun 27 '19 at 05:53
  • @ClausIbsen Yep it has [#publishAsync](https://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/com/amazonaws/services/sns/AmazonSNSAsync.html#publishAsync-com.amazonaws.services.sns.model.PublishRequest-) – geg Jun 27 '19 at 16:59
  • What version of AWS SNS is that? As we are using 1.11.559 currently and it does not have that api – Claus Ibsen Jun 27 '19 at 18:23
  • hmm I see it in `aws-java-sdk-sns-1.11.301`: `com.amazonaws.services.sns.AmazonSNSAsync` – geg Jul 01 '19 at 15:55
  • Ah okay - So I took a 2nd look and worked on a little prototype: https://github.com/apache/camel/commit/9605406b986b57edfd7415bd569654fab34a11d3. If you get the time you are welcome to log a JIRA and continue this work as it requires some unit test updates and also update the docs a bit. Also mind that AWS SNS uses a default thread pool size of 50 for its async thread pool. This value is configured with the max connections settings etc. – Claus Ibsen Jul 02 '19 at 06:40

0 Answers0