spring-cloud / spring-cloud-stream

Framework for building Event-Driven Microservices
http://cloud.spring.io/spring-cloud-stream
Apache License 2.0
1.01k stars 614 forks source link

Missing Headers Problem #2983

Closed omercelikceng closed 3 months ago

omercelikceng commented 3 months ago

Hello,

While working on a development related to Spring Cloud Stream, I noticed a situation that is also relevant to Spring Cloud Function.

To explain the issue clearly, we will first examine a method from Spring Cloud Function. The following method exhibits different behaviors. In some cases, it generates the output message using the input header, while in other cases, it does not consider the input header at all. This results in some variations in the code. In other words, the code below can sometimes directly set the headers provided in the input to the output header. Sometimes, it creates the output headers without using the input headers.

Screenshot 2024-08-01 233525

Now, let's examine the method affected by the above code. I have written some tests, and based on the results, the target-protocol header is sometimes set and sometimes not. Therefore, I have made the relevant development.

However, I still have some questions that I do not fully understand. I would greatly appreciate your help. Is the target-protocol header a value that should be set for every message? If so, there are many places that we need to correct. Could you please provide me with information on this matter?

I am a bit confused, so I wanted to ask you before continuing with the development. Thank you.

omercelikceng commented 3 months ago

@olegz, hello. Thank you very much for your interest. However, there are other situations where these headers are not set. If this target_protocol needs to be set in all cases, I will need to make further developments accordingly. Should I open another pull request to explain this better? Could you inform me about this?

olegz commented 3 months ago

Please do