Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create queues at startup #118

Closed
arianbessonart opened this issue Aug 24, 2017 · 7 comments
Closed

Create queues at startup #118

arianbessonart opened this issue Aug 24, 2017 · 7 comments

Comments

@arianbessonart
Copy link

Version: 0.13.5

I'm running elasticmq with docker trying to create two queues at startup, but I couldn't get it done.

Dockerfile

FROM java:8-jre-alpine

ARG VERSION=0.13.5

EXPOSE 9324

ADD https://s3-eu-west-1.amazonaws.com/softwaremill-public/elasticmq-server-${VERSION}.jar /elasticmq-server.jar

COPY elasticmq.conf /etc/elasticmq/elasticmq.conf

VOLUME /etc/elasticmq

CMD ["java", "-Djava.net.preferIPv4Stack=true", "-Dconfig.file=/etc/elasticmq/elasticmq.conf", "-jar", "/elasticmq-server.jar"]

elasticmq.conf

include classpath("application.conf")

queues {
    queue1 {
        deadLettersQueue {
            name = "local-activities"
            maxReceiveCount = 3
        }
    }
    local-activities {}
    queue2 {
        deadLettersQueue {
            name = "local-notifications"
            maxReceiveCount = 3
        }
    }
    local-notifications {}
}

Log

fake-sqs_1  | 02:50:46.989 [elasticmq-akka.actor.default-dispatcher-3] INFO  o.e.rest.sqs.TheSQSRestServerBuilder - Started SQS rest server, bind address 0.0.0.0:9324, visible server address http://localhost:9324
fake-sqs_1  | 02:50:47.185 [elasticmq-akka.actor.default-dispatcher-3] ERROR o.elasticmq.actor.QueueManagerActor - Cannot create queue, its dead letters queue doesn't exists: QueueData(queue2,MillisVisibilityTimeout(30000),PT0S,PT0S,2017-08-24T02:50:46.993Z,2017-08-24T02:50:46.993Z,Some(DeadLettersQueueData(local-notifications,3)),None)
fake-sqs_1  | 02:50:47.189 [elasticmq-akka.actor.default-dispatcher-3] ERROR o.elasticmq.actor.QueueManagerActor - Cannot create queue, its dead letters queue doesn't exists: QueueData(queue1,MillisVisibilityTimeout(30000),PT0S,PT0S,2017-08-24T02:50:47.188Z,2017-08-24T02:50:47.188Z,Some(DeadLettersQueueData(local-activities,3)),None)
fake-sqs_1  | 02:50:47.195 [main] INFO  org.elasticmq.server.Main$ - === ElasticMQ server (0.13.5) started in 5059 ms ===

The configuration file is correctly?
I could create the queues with the rest api
http://localhost:9324/?Action=CreateQueue&QueueName=local-activities&Attribute.1.Name=VisibilityTimeout&Attribute.1.Value=40&Version=2012-11-05&Expires=2012-10-18T22%3A52%3A43PST&AUTHPARAMS
but I want to do it at startup, is an issue? Or I miss something?

Thanks

@ankon
Copy link
Contributor

ankon commented Aug 31, 2017

Just checking: On the chance that the creation of queues happens in order of the file, did you try creating the DLQs first?

include classpath("application.conf")

queues {
    local-activities {}
    queue1 {
        deadLettersQueue {
            name = "local-activities"
            maxReceiveCount = 3
        }
    }
    local-notifications {}
    queue2 {
        deadLettersQueue {
            name = "local-notifications"
            maxReceiveCount = 3
        }
    }
}

@arianbessonart
Copy link
Author

arianbessonart commented Aug 31, 2017

@ankon Trying that configs, but only get one queue created, the first one:

fake-sqs_1  | 14:19:48.090 [elasticmq-akka.actor.default-dispatcher-5] INFO  o.e.rest.sqs.TheSQSRestServerBuilder - Started SQS rest server, bind address 0.0.0.0:9324, visible server address http://localhost:9324
fake-sqs_1  | 14:19:48.443 [elasticmq-akka.actor.default-dispatcher-5] INFO  o.elasticmq.actor.QueueManagerActor - Creating queue QueueData(local-activities,MillisVisibilityTimeout(30000),PT0S,PT0S,2017-08-31T14:19:48.091Z,2017-08-31T14:19:48.091Z,None,None)
fake-sqs_1  | 14:19:48.486 [elasticmq-akka.actor.default-dispatcher-5] INFO  o.elasticmq.actor.QueueManagerActor - Creating queue QueueData(queue1,MillisVisibilityTimeout(30000),PT0S,PT0S,2017-08-31T14:19:48.485Z,2017-08-31T14:19:48.485Z,Some(DeadLettersQueueData(local-activities,3)),None)
fake-sqs_1  | 14:19:48.496 [main] INFO  org.elasticmq.server.Main$ - === ElasticMQ server (0.13.5) started in 5109 ms ===

@samredway
Copy link

Can confirm that I am having a very similar problem. Also using a Docker container with very similar config. For me also it fails to create the main queue (without errors) - but does create the dead letter queue. Some experimentation revealed that if I remove the section:

deadLettersQueue { ... }

That the queue instantiated. So I believe there is a problem with linking the dead letter queue to the main queue.

@adamw
Copy link
Member

adamw commented Nov 16, 2017

@samredway which ElasticMQ version and can you paste your whole problematic configuration?

@samredway
Copy link

samredway commented Nov 16, 2017

Hi @adamw ... my bad.

I was running 0.13.1 and did not realise this was not the latest build. I rebuilt my docker image with 0.13.8 and the configuration worked as expected. So the updated version has this problem solved from my perspective.

@adamw
Copy link
Member

adamw commented Aug 11, 2018

There's now an "offical" docker image available, see: https://github.com/adamw/elasticmq#elasticqmq-via-docker

@adamw
Copy link
Member

adamw commented Dec 8, 2020

Probably out of date

@adamw adamw closed this as completed Dec 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants