amazon-sqs-java-messaging-lib
amazon-sqs-java-messaging-lib copied to clipboard
set Q url with different AWS account
Hello team, How can set the Q url if the q is exists on different AWS account for both receiving and sending.
SQSConnectionFactory connectionFactory = new SQSConnectionFactory( new ProviderConfiguration(), AmazonSQSClientBuilder.standard() .withCredentials( new DefaultAWSCredentialsProviderChain()) );
@Bean
public DefaultJmsListenerContainerFactory jmsListenerContainerFactory() {
DefaultJmsListenerContainerFactory factory =
new DefaultJmsListenerContainerFactory();
factory.setConnectionFactory(this.connectionFactory);
factory.setDestinationResolver(new DynamicDestinationResolver());
factory.setConcurrency("3-10");
return factory;
}
and my listener is looks like
@JmsListener(destination = "${jms.outboundQueueName}") public void onReceive(String message) { try { log.info("onReceive request and send to : "+message); } catch (Exception e) { log.warn("sendErrorMessage" + e.getMessage()); } }
Eg: How can access this q using url (eg: https://sqs.ap-southeast-2.amazonaws.com/123456/qname)
Thanks Sidath