Skip to content
New issue

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

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

Already on GitHub? # to your account

AMQP error message #301

Closed
tobilg opened this issue Apr 14, 2018 · 9 comments
Closed

AMQP error message #301

tobilg opened this issue Apr 14, 2018 · 9 comments

Comments

@tobilg
Copy link
Contributor

tobilg commented Apr 14, 2018

When trying to implement topic-based routing with RabbitMQ and Tile38, I'm seeing the following error message:

Endpoint connect/send error: 48: amqp://guest:guest@127.0.0.1:5672/webhook-events?type=topic&route=hook.http: Exception (406) Reason: "PRECONDITION_FAILED - inequivalent arg 'type' for exchange 'webhook-events' in vhost '/': received 'direct' but current is 'topic'"

I'm pretty confident I set up the exchange correctly:

alt text

I don't understand where the received 'direct' but current is 'topic' is coming from unfortunately. Do you happen to have an idea? Thanks!

@tobilg
Copy link
Contributor Author

tobilg commented Apr 14, 2018

Ok, so I deleted the exchange from RabbitMQ, deleted all hooks from Tile38 and created a new one with the amqp://guest:guest@127.0.0.1:5672/webhook-events?type=topic&route=hook.http endpoint.

Turns out Tile38 creates the queue and exchanges, but it seems to default to type direct, even if the connection string says type=topic.

I suspect the type parameter is not respected, as direct seems to be always set: https://github.com/tidwall/tile38/blob/master/controller/endpoint/amqp.go#L73 Also, the type param seems to be missing from https://github.com/tidwall/tile38/blob/master/controller/endpoint/endpoint.go#L54 and https://github.com/tidwall/tile38/blob/master/controller/endpoint/endpoint.go#L485 only seems to be able to set the route param.

@tidwall
Copy link
Owner

tidwall commented Apr 15, 2018

I'm seeing the same issue. From http://tile38.com/commands/sethook :

The following optional parameters are available for this 
hook, the listed value is the default value:

type - ‘direct’
durable - true
immediate - false
mandatory - false
auto_delete - false
internal - false
no_wait - false
delivery_mode - 1
route - tile38

But it seems that the only available option is route.
I could wire up all these options, but other than route and type, do we actually need them all to be customizable through the webhook uri?

@tobilg
Copy link
Contributor Author

tobilg commented Apr 15, 2018

Thanks for the fast response! I think it’d be great to be able to set all these parameters via the endpoint query string, as outlined in the docs.

@tidwall
Copy link
Owner

tidwall commented Apr 15, 2018

Sounds good. I'll see what I can do. Thanks

tidwall added a commit that referenced this issue Apr 17, 2018
@tidwall
Copy link
Owner

tidwall commented Apr 17, 2018

I just pushed an update that allows for setting each of the paramaters.

@tobilg
Copy link
Contributor Author

tobilg commented Apr 18, 2018

Thanks a lot! Is the Docker image „latest“ tag built automatically?

I guess there will be another release soon as well? That’d be great 😀👍🏻

@tobilg tobilg closed this as completed Apr 18, 2018
@tidwall
Copy link
Owner

tidwall commented Apr 18, 2018

It does build automatically, but it tracks the latest version, not the master branch.

In this case latest -> v1.12.0.

I may need to figure out a better approach. Is it normal for docker latest tag to track the master branch?

@tobilg
Copy link
Contributor Author

tobilg commented Apr 18, 2018

I’d say it is a common practice to have latest point to master. Other people might disagree though... 😀

@tobilg
Copy link
Contributor Author

tobilg commented Apr 22, 2018

@tidwall is this change in the current latest Docker image? The exchange seems still to be set to direct even when specifying topic in the endpoint URI... I'm asking because https://hub.docker.com/r/tile38/tile38/tags/ shows that latest was built 2 days ago. Thanks!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants