From c63468a704869dd60e231383c8206895245c0add Mon Sep 17 00:00:00 2001 From: uwer Date: Wed, 3 May 2023 16:22:37 +1000 Subject: [PATCH 1/3] disabled AMQP queue and binding for type topic --- internal/endpoint/amqp.go | 43 ++++++++++++++++++++------------------- 1 file changed, 22 insertions(+), 21 deletions(-) diff --git a/internal/endpoint/amqp.go b/internal/endpoint/amqp.go index b69a22ef..084f1884 100644 --- a/internal/endpoint/amqp.go +++ b/internal/endpoint/amqp.go @@ -93,28 +93,29 @@ func (conn *AMQPConn) Send(msg string) error { ); err != nil { return err } + if conn.ep.AMQP.Type != "topic" { + // Create queue if queue don't exists + if _, err := channel.QueueDeclare( + conn.ep.AMQP.QueueName, + conn.ep.AMQP.Durable, + conn.ep.AMQP.AutoDelete, + false, + conn.ep.AMQP.NoWait, + nil, + ); err != nil { + return err + } - // Create queue if queue don't exists - if _, err := channel.QueueDeclare( - conn.ep.AMQP.QueueName, - conn.ep.AMQP.Durable, - conn.ep.AMQP.AutoDelete, - false, - conn.ep.AMQP.NoWait, - nil, - ); err != nil { - return err - } - - // Binding exchange to queue - if err := channel.QueueBind( - conn.ep.AMQP.QueueName, - conn.ep.AMQP.RouteKey, - conn.ep.AMQP.QueueName, - conn.ep.AMQP.NoWait, - nil, - ); err != nil { - return err + // Binding exchange to queue + if err := channel.QueueBind( + conn.ep.AMQP.QueueName, + conn.ep.AMQP.RouteKey, + conn.ep.AMQP.QueueName, + conn.ep.AMQP.NoWait, + nil, + ); err != nil { + return err + } } conn.conn = c From 8be1890b1dbad69e32901710d5bf6e909adaf671 Mon Sep 17 00:00:00 2001 From: uwer Date: Wed, 3 May 2023 16:23:04 +1000 Subject: [PATCH 2/3] disabled git lookup --- scripts/build.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/build.sh b/scripts/build.sh index e441103d..c2bd9cc4 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -16,12 +16,12 @@ if [ "$(which go)" == "" ]; then fi # Hardcode some values to the core package. -if [ -d ".git" ]; then - VERSION=$(git describe --tags --abbrev=0) - GITSHA=$(git rev-parse --short HEAD) - LDFLAGS="$LDFLAGS -X github.com/tidwall/tile38/core.Version=${VERSION}" - LDFLAGS="$LDFLAGS -X github.com/tidwall/tile38/core.GitSHA=${GITSHA}" -fi +#if [ -d ".git" ]; then +# VERSION=$(git describe --tags --abbrev=0) +# GITSHA=$(git rev-parse --short HEAD) +# LDFLAGS="$LDFLAGS -X github.com/tidwall/tile38/core.Version=${VERSION}" +# LDFLAGS="$LDFLAGS -X github.com/tidwall/tile38/core.GitSHA=${GITSHA}" +#fi LDFLAGS="$LDFLAGS -X github.com/tidwall/tile38/core.BuildTime=$(date +%FT%T%z)" # Generate the core package From bbeccaeed094ccaec9db75767294bfe8bf452a0d Mon Sep 17 00:00:00 2001 From: uwer Date: Thu, 4 May 2023 09:03:57 +1000 Subject: [PATCH 3/3] reversed disabling git metadata --- scripts/build.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/build.sh b/scripts/build.sh index c2bd9cc4..e441103d 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -16,12 +16,12 @@ if [ "$(which go)" == "" ]; then fi # Hardcode some values to the core package. -#if [ -d ".git" ]; then -# VERSION=$(git describe --tags --abbrev=0) -# GITSHA=$(git rev-parse --short HEAD) -# LDFLAGS="$LDFLAGS -X github.com/tidwall/tile38/core.Version=${VERSION}" -# LDFLAGS="$LDFLAGS -X github.com/tidwall/tile38/core.GitSHA=${GITSHA}" -#fi +if [ -d ".git" ]; then + VERSION=$(git describe --tags --abbrev=0) + GITSHA=$(git rev-parse --short HEAD) + LDFLAGS="$LDFLAGS -X github.com/tidwall/tile38/core.Version=${VERSION}" + LDFLAGS="$LDFLAGS -X github.com/tidwall/tile38/core.GitSHA=${GITSHA}" +fi LDFLAGS="$LDFLAGS -X github.com/tidwall/tile38/core.BuildTime=$(date +%FT%T%z)" # Generate the core package