amazon-sqs-java-messaging-lib icon indicating copy to clipboard operation
amazon-sqs-java-messaging-lib copied to clipboard

set Q url with different AWS account

Open sidath80 opened this issue 7 years ago • 0 comments

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

sidath80 avatar Oct 22 '18 11:10 sidath80