Not able to feed custom.conf before I start the embedded server. Need your help to know how pass the custom conf for embedded server

38 views
Skip to first unread message

rajashekar reddy

unread,
Apr 24, 2020, 8:48:40 AM4/24/20
to ElasticMQ

Hi, 

I am starting the server like below 

This is my java code
System.setProperty("config.file", "custom.conf");
server = SQSRestServerBuilder.start();
server.waitUntilStarted();
String region = "elasticmq";
String accessKey = "x";
String secretKey = "x";
AmazonSQS client = AmazonSQSClientBuilder.standard()
.withCredentials(new AWSStaticCredentialsProvider(new BasicAWSCredentials(accessKey, secretKey)))
.withEndpointConfiguration(new AwsClientBuilder.EndpointConfiguration(awsSqsMockEndpoint, region)).build();
System.out.println(client.getQueueUrl("testQueue1").getQueueUrl());

And conf

include classpath("application.conf")

queues {
    testQueue1{
        defaultVisibilityTimeout = 10 seconds
        delay = 5 seconds
        receiveMessageWait = 0 seconds
        deadLettersQueue {
            name = "queue1-dead-letters"
            maxReceiveCount = 3
        }
        fifo = false
        contentBasedDeduplication = false
        copyTo = "audit-queue-name"
        moveTo = "redirect-queue-name"
        tags {
            tag1 = "tagged1"
            tag2 = "tagged2"
        }
    }
    queue1-dead-letters { }
    audit-queue-name { }
    redirect-queue-name { }
}

is this right way to start the server with custom conf, 

I am aware of creating queues with client, but that does not seem to be externalizing the config. 

Thanks
Reply all
Reply to author
Forward
0 new messages