use of com.amazon.sqs.javamessaging.AmazonSQSMessagingClientWrapper in project kylo by Teradata.
the class SqsService method getQueue.
@Override
public Queue getQueue(String queueName) {
String name = destinationResolver.resolveName(queueName);
try {
// Create a new Queue if required
SQSConnection connection = connectionFactory.createConnection();
AmazonSQSMessagingClientWrapper client = connection.getWrappedAmazonSQSClient();
if (!client.queueExists(name)) {
client.createQueue(name);
}
// Queue must already exist
Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
return session.createQueue(name);
} catch (JMSException e) {
throw new IllegalStateException(e);
}
}
use of com.amazon.sqs.javamessaging.AmazonSQSMessagingClientWrapper in project goobi-workflow by intranda.
the class ExternalConnectionFactory method createQueues.
private static void createQueues(SQSConnection connection) throws JMSException {
ConfigurationHelper config = ConfigurationHelper.getInstance();
AmazonSQSMessagingClientWrapper sqsClient = connection.getWrappedAmazonSQSClient();
// we need to explicitly create the queues in SQS
if (!sqsClient.queueExists(config.getQueueName(QueueType.COMMAND_QUEUE))) {
createFifoQueue(sqsClient, config.getQueueName(QueueType.COMMAND_QUEUE));
}
if (!sqsClient.queueExists(config.getQueueName(QueueType.EXTERNAL_QUEUE))) {
createFifoQueue(sqsClient, config.getQueueName(QueueType.EXTERNAL_QUEUE));
}
}
Aggregations