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

Provide correct default for Federation Upstream "MessageTTL" #230

Closed
StateOfDenial opened this issue Aug 30, 2022 · 2 comments · Fixed by #233
Closed

Provide correct default for Federation Upstream "MessageTTL" #230

StateOfDenial opened this issue Aug 30, 2022 · 2 comments · Fixed by #233

Comments

@StateOfDenial
Copy link

Environment

Go version: 1.19
Rabbithole version: v2.12.0
RabbitMQ version: 3.10.2

Issue

According to the RabbitMQ documentation, when creating an exchange federation upstream the default value for Message TTL is none, or blank. However when I don't set the MessageTTL value for an API call (see code example), the library sets the value to 0 which has a different meaning and I can not intentionally pass in a blank value.

Expected behaviour

The ability to pass in an explicit empty value and for the default value to be empty.

Code example

package main

import (
    "github.com/michaelklishin/rabbit-hole/v2"
)

func main() {
    rmqc, _ := rabbithole.NewClient("http://rabbitmq.rabbitmq-poc.internal:15672/rabbitmq", "****", "****")
    ups, _ := rmqc.ListFederationUpstreams()
    fmt.Println(ups)

    rmqc.PutFederationUpstream("/", "test", rabbithole.FederationDefinition{
        Uri: rabbithole.URISet{"amqp://vm-cluster.rabbitmq-poc.internal"},
        ReconnectDelay: 3245024,
        AckMode: "on-confirm",
        TrustUserId: false,
        Exchange: "toCloud2",
    })
@michaelklishin
Copy link
Owner

This is very likely just the behavior of the JSON serialisation. You are welcome to submit a PR.

@ahmadalli
Copy link

ahmadalli commented Feb 20, 2023

@michaelklishin Has this been released? I'm still having the same situation on v2.12.0
Thanks for releasing it 👍

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

Successfully merging a pull request may close this issue.

3 participants