Comments (9)
You need to also specify the nodeAddress
with .withServerAddress(new NodeAddress("http", "localhost", 9324, ""))
. This is the address that is reported in when creating the queue url (it may be different then the bound one because of network setup).
However this is still inconvenient, when using a custom port, the server address should be changed as well, unless a custom one is provided. So that's a thing to fix.
from elasticmq.
yes. Because I want to let system choose a ephemeral port, I passed port 0 to withPort(...) method. I can't really construct NodeAddress with port 0 to withServerAddress(...) method. I would expect server address to be changed to the actual bound port (e.g. 59923).
from elasticmq.
is there a difference between using withServerAddress
and withInterface
with withPort
? ie. are they setting up the same thing?
from elasticmq.
No; withInterface
and withPort
specify to what interface/port the socket will bind. withServerAddress
is the address that will be returned e.g. in the queue url strings. These are usually the same, but may differ if e.g. the server is behind a NAT, in a docker container etc.
from elasticmq.
@adamw this caught me out as well and I almost abandoned ElasticMQ as a result.
Since it is the common case that the bound and node addresses are equal, wouldn't it make sense if they were permitted to differ by exception only? Otherwise the API violates the principle of least surprise.
from elasticmq.
Yes I definitely want to take care of this in the next release, once I'll have some more time :)
from elasticmq.
I'm going to close this issue; although confusing, I did not find a good way to automatically set node-address basing on bind address. Even the defaults (bind: 0.0.0.0, node-address host: localhost) are different, plus ElasticMQ can be configured through code or config file.
I added a note in the readme, close to the top, hopefully people will spot that :)
from elasticmq.
I have started elasticMQ server by using "java -jar elasticmq-server-0.13.8.jar" command and below response i got.
12:04:09.476 [main] INFO org.elasticmq.server.Main$ - Starting ElasticMQ server
(0.13.8) ...
12:04:10.265 [elasticmq-akka.actor.default-dispatcher-3] INFO akka.event.slf4j.
Slf4jLogger - Slf4jLogger started
12:04:11.555 [elasticmq-akka.actor.default-dispatcher-3] INFO o.e.rest.sqs.TheS
QSRestServerBuilder - Started SQS rest server, bind address 0.0.0.0:9324, visibl
e server address http://localhost:9324
12:04:11.555 [main] INFO org.elasticmq.server.Main$ - === ElasticMQ server (0.1
3.8) started in 2628 ms ===
12:19:12.784 [elasticmq-akka.actor.default-dispatcher-13] INFO o.elasticmq.acto
r.QueueManagerActor - Creating queue QueueData(SQS_QUEUE_NAME,MillisVisibilityTi
meout(30000),PT60S,PT0S,2017-12-28T12:19:12.618+05:30,2017-12-28T12:19:12.618+05
:30,None,None)
But when i tried to access http://localhost:9324, it is displaying blank page with "The requested resource could not be found." message. Is something wrong with my SQS server ?
from elasticmq.
@sfanish no, there's no http interface, so you shouldn't expect to be able to open the page in the browser. Instead, that address exposes a number of REST endpoints which can be accessed using an AWS client - and specifying http://localhost:9324
as the endpoint, instead of the AWS one.
from elasticmq.
Related Issues (20)
- Actor System does not shut down when using `SQSRestServerBuilder#stopAndWait` - resulting in main process hanging indefinitely HOT 2
- prebuilt arm builds for softwaremill/elasticmq-native is not working HOT 1
- Stale Documentation for DeadLetterQueue creation HOT 2
- Publishing messages with delay does not work as expected HOT 1
- Could not find UI files error on 1.4.5-RC1 docker image HOT 2
- Fifo delay queue is delivering messages immediately instead of delaying them HOT 2
- Migrate from akka to pekko? HOT 6
- Automatic creation of queue does not work (v1.4.6) HOT 1
- IllegalArgumentException: Couldn't find header X-Amz-Target HOT 6
- x-amz-json-1.0 not properly serializing error responses HOT 5
- AWS JSON Protocol - MessageAttributes key has appeared? HOT 3
- JSON protocol support HOT 1
- DeadLetterQueueSourceArn missing while receiving message from DLQ HOT 1
- Push images to ECR HOT 2
- Trigger Events Based on Messages in Queue HOT 4
- Exception when running routes spray.json.DeserializationException HOT 3
- "MD5 returned by SQS does not match the calculation on the original request" when using AWS JSON protocol and message attributes with custom data types HOT 1
- java.lang.IllegalArgumentException: Couldn't find header X-Amz-Target
- Cannot create Queue with AWS SDK. HOT 6
- 404s after updating AWS SDKs
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from elasticmq.