Create Queue Using AWS SQS Conenctor In Mule

 

In this tutorial we will demonstrate how can we Create Queue Using AWS SQS Conenctor In Mule.

Create project in anypoint studio

Drag and drop create queue operation for amazon SQS connector(kindly add the module if it is not visible in mule palette)

Configure the Queue name as MuleSampleQueue

 

Configure the connection details(provide the access key and secret key)

 

Deploy and test the application

Got the below error as Access Denied while testing

ERROR 2020-03-22 20:12:47,184 [[MuleRuntime].io.06: [amazon-s3-sqs].amazon-s3-sqsFlow.BLOCKING @ea364a6] [event: 635e1a80-6c4b-11ea-afae-040e3cd1eac7] org.mule.runtime.core.internal.exception.OnErrorPropagateHandler:

********************************************************************************

Message : The component ‘createQueue’ from the connector ‘Amazon SQS’ attempted to throw ‘SQS:UNKNOWN’, but only [SQS:RETRY_EXHAUSTED, SQS:CONNECTIVITY] errors are allowed.

Element : amazon-s3-sqsFlow/processors/0 @ amazon-s3-sqs:amazon-s3-sqs.xml:16 (Create queue)

Element XML : <sqs:create-queue doc:name=”Create queue” doc:id=”0b705887-712e-437c-818f-37b081815835″ queueName=”MuleSampleQueue” config-ref=”Amazon_SQS_Configuration”></sqs:create-queue>

Error type : MULE:UNKNOWN

——————————————————————————–

Root Exception stack trace:

com.amazonaws.services.sqs.model.AmazonSQSException: Access to the resource https://sqs.us-east-1.amazonaws.com/ is denied. (Service: AmazonSQS; Status Code: 403; Error Code: AccessDenied; Request ID: d4eab416-665c-538b-b792-e2e71dfae0f9)

at com.amazonaws.http.AmazonHttpClient$RequestExecutor.handleErrorResponse(AmazonHttpClient.java:1712)

at com.amazonaws.http.AmazonHttpClient$RequestExecutor.executeOneRequest(AmazonHttpClient.java:1367)

at com.amazonaws.http.AmazonHttpClient$RequestExecutor.executeHelper(AmazonHttpClient.java:1113)

at com.amazonaws.http.AmazonHttpClient$RequestExecutor.doExecute(AmazonHttpClient.java:770)

at com.amazonaws.http.AmazonHttpClient$RequestExecutor.executeWithTimer(AmazonHttpClient.java:744)

at com.amazonaws.http.AmazonHttpClient$RequestExecutor.execute(AmazonHttpClient.java:726)

at com.amazonaws.http.AmazonHttpClient$RequestExecutor.access$500(AmazonHttpClient.java:686)

at com.amazonaws.http.AmazonHttpClient$RequestExecutionBuilderImpl.execute(AmazonHttpClient.java:668)

at com.amazonaws.http.AmazonHttpClient.execute(AmazonHttpClient.java:532)

at com.amazonaws.http.AmazonHttpClient.execute(AmazonHttpClient.java:512)

at com.amazonaws.services.sqs.AmazonSQSClient.doInvoke(AmazonSQSClient.java:2207)

at com.amazonaws.services.sqs.AmazonSQSClient.invoke(AmazonSQSClient.java:2174)

at com.amazonaws.services.sqs.AmazonSQSClient.invoke(AmazonSQSClient.java:2163)

at com.amazonaws.services.sqs.AmazonSQSClient.executeCreateQueue(AmazonSQSClient.java:812)

at com.amazonaws.services.sqs.AmazonSQSClient.createQueue(AmazonSQSClient.java:784)

at org.mule.extension.sqs.internal.connection.SQSConnection.createQueue(SQSConnection.java:97)

at org.mule.extension.sqs.internal.operation.SQSOperations.createQueue(SQSOperations.java:155)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:498)

at org.springframework.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:282)

at org.mule.runtime.module.extension.internal.runtime.execution.ReflectiveMethodComponentExecutor.lambda$execute$1(ReflectiveMethodComponentExecutor.java:80)

at org.mule.runtime.core.api.util.ExceptionUtils.tryExpecting(ExceptionUtils.java:227)

at org.mule.runtime.core.api.util.ClassUtils.withContextClassLoader(ClassUtils.java:915)

at org.mule.runtime.core.api.util.ClassUtils.withContextClassLoader(ClassUtils.java:879)

at org.mule.runtime.module.extension.internal.runtime.execution.ReflectiveMethodComponentExecutor.execute(ReflectiveMethodComponentExecutor.java:79)

at org.mule.runtime.module.extension.internal.runtime.operation.ReflectiveMethodOperationExecutor.execute(ReflectiveMethodOperationExecutor.java:64)

at org.mule.runtime.module.extension.internal.runtime.execution.InterceptableOperationExecutorWrapper.execute(InterceptableOperationExecutorWrapper.java:60)

at org.mule.runtime.module.extension.internal.runtime.operation.DefaultExecutionMediator.lambda$null$3(DefaultExecutionMediator.java:149)

at org.mule.runtime.core.api.util.ExceptionUtils.tryExpecting(ExceptionUtils.java:227)

at org.mule.runtime.core.api.util.ClassUtils.withContextClassLoader(ClassUtils.java:915)

at org.mule.runtime.core.api.util.ClassUtils.withContextClassLoader(ClassUtils.java:879)

at org.mule.runtime.module.extension.internal.runtime.operation.DefaultExecutionMediator.lambda$executeWithInterceptors$9(DefaultExecutionMediator.java:149)

at reactor.core.* (20 elements filtered from stack; set debug level logging or ‘-Dmule.verbose.exceptions=true’ for everything)(Unknown Source)

at org.mule.runtime.core.privileged.processor.chain.* (2 elements filtered from stack; set debug level logging or ‘-Dmule.verbose.exceptions=true’ for everything)(Unknown Source)

at reactor.core.* (5 elements filtered from stack; set debug level logging or ‘-Dmule.verbose.exceptions=true’ for everything)(Unknown Source)

at java.util.concurrent.FutureTask.run(FutureTask.java:266)

at org.mule.service.scheduler.internal.AbstractRunnableFutureDecorator.doRun(AbstractRunnableFutureDecorator.java:111)

at org.mule.service.scheduler.internal.RunnableFutureDecorator.run(RunnableFutureDecorator.java:54)

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)

at java.lang.Thread.run(Thread.java:748)

To resolve the error add the permissions for SQS in IAM in AWS console

Create Queue Using AWS SQS Conenctor In Mule

 

Test the project from Postman: you can see queue created successfully in aws

Create Queue Using AWS SQS Conenctor In Mule

Sample application: download sample project

  
Thank you for taking out time to read the above post. Hope you found it useful. In case of any questions, feel free to comment below. Also, if you are keen on knowing about a specific topic, happy to explore your recommendations as well.
 
For any latest updates or posts on our website, you can follow us on LinkedIn. Look forward to connecting with you there.


Share this:
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments