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

[🐛 BUG]: Jobs AMQP headers with list type not mapped to RR job #1793

Closed
1 task done
iborysenko opened this issue Nov 29, 2023 · 6 comments · Fixed by roadrunner-server/amqp#110
Closed
1 task done
Assignees
Labels
B-bug Bug: bug, exception B-regression Bug: regression bugs
Milestone

Comments

@iborysenko
Copy link

No duplicates 🥲.

  • I have searched for a similar issue in our bug tracker and didn't find any solutions.

What happened?

A bug happened!
Jobs AMQP headers with list type not mapped to RR job

Screenshot 2023-11-29 at 16 25 02

Version (rr --version)

2023.3

How to reproduce the issue?

Publish message with list type headers

Relevant log output

No response

@rustatian
Copy link
Member

rustatian commented Nov 29, 2023

Hey @iborysenko 👋
Please attach a worker, configuration (.rr.yaml) and all the needed data to reproduce this problem.

EDIT: Also, attach your composer.json or specify versions. Also, if you push headers via separate script, attach it as well.

@rustatian rustatian added the W-waiting on response Wait: waiting for the issue creator response label Nov 29, 2023
@iborysenko
Copy link
Author

Hey @rustatian

jobs:
    pipelines:
        processing_pipeline:
            driver: amqp
            config:
              queue: my-queue
              exchange: my-exchange
              routing_key: my-queue-routing-key
              exchange_type: direct
              exchange_durable: true
              durable: true
              consume_all: true
              redial_timeout: 600
  1. Go to the RabbitMQ Management UI and publish a message to the my-queue with headers (like on screenshot above)
  2. Start consuming messages via RR.
  3. RR forward only headers with type string but not list

We are using Krakend-gateway to publish webhooks to the queue, and then RR consumes them
Krakend put allowed HTTP headers to the AMQP Message Headers as List

    headerValues := make([]interface{}, len(vs))
    for k, v := range vs {
    headerValues[k] = v
    }
    headers[k] = headerValues

Anyway we will fork this lib and fix it for us, but I noticed that RR does not support these header type

@rustatian
Copy link
Member

@iborysenko There is no list data structure in Go.

@rustatian
Copy link
Member

I'm not sure, why do you think, that we support only string headers: https://github.com/roadrunner-server/amqp/blob/master/amqpjobs/conv.go

@iborysenko
Copy link
Author

Try
Screenshot 2023-11-29 at 17 45 58

Result will be

{"id":"99c87c46-8935-49cd-94cd-e48a9697cc36","job":"deduced_by_rr","driver":"amqp","queue":"my-queue","headers":{"Traceparent":["00-bb7aeaec5ce34668d9dd163d1ee8dccb-aa92cee3135e0710-01"],"Uber-Trace-Id":["bb7aeaec5ce34668d9dd163d1ee8dccb:aa92cee3135e0710:0:1"],"stringHeader":["stringValue"]},"pipeline":"processing_pipeline"}

@rustatian
Copy link
Member

Ok, in your case, this would be a slice of any types which are actually strings. I'll add a switch case for that and release a bugfix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
B-bug Bug: bug, exception B-regression Bug: regression bugs
Projects
Status: ✅ Done
Development

Successfully merging a pull request may close this issue.

2 participants