Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 936717
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T21:21:33+00:00 2026-05-15T21:21:33+00:00

I implemented the Message interface to include some headers for use with a HeaderValueRouter

  • 0

I implemented the Message interface to include some headers for use with a HeaderValueRouter on server side.

Within one VM this works (tested using a filter between two endpoints).

But if I send the message through HttpOutboundGatway my fields get stripped (not included in the HttpRequest). And therefor the routing information is lost on server side.

Am I not supposed to manipulate headers?

public class TaskMessage implements Message<String> {

    private MessageHeaders headers;
    private String payload;

    public TaskMessage(String taskId, String boxId, String payload) {
        super();
        this.taskId = taskId;
        this.boxId = boxId;
        this.payload = payload;
        StringMessage sm = new StringMessage(payload);
        Set<String> keySet = sm.getHeaders().keySet();

        HashMap<String, Object> map = new HashMap<String, Object>();
        for (String key : keySet) {
            map.put(key, sm.getHeaders().get(key));
        }
        map.put("taskId", taskId);
        map.put("boxId", boxId);
        headers = new MessageHeaders(map);
    }
    @Override
    public MessageHeaders getHeaders() {
        return headers;
    }

    @Override
    public String getPayload() {
        return payload;
    }
}

EDIT:

The version is 1.0.3

The part of my configuration is:

<si:inbound-channel-adapter ref="jdbcInputAdapter" method="fetchData" channel="msgChannel">
    <si:poller max-messages-per-poll="1"> 
        <si:interval-trigger interval="5000" />
    </si:poller>
</si:inbound-channel-adapter>

<http:outbound-gateway id="httpChannelAdapter" auto-startup="true" request-timeout="1000" request-channel="msgChannel" reply-channel="replyChannel" default-url="http://localhost:8080/taskserver/gateway"/>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T21:21:34+00:00Added an answer on May 15, 2026 at 9:21 pm

    The version you are using does not support (custom) header serialization. The solution would be to craft a request that contains all the information needed and pass it along as the payload. The new REST based http support in version 2.0.x does support header mapping and also exposes extension points for converting messages (including headers).

    As a side note, it is quite uncommon to have to implement a custom Message, so instead of doing that I’d create a message using MessageBuilder

    MessageBuilder.withPayload("foo").setHeader("taskId", "someTaskId").build();
    

    In general not all headers can be transferred with all protocols, so if you want to use a distributed system it is usually more flexible to pack all information you need to send into the payload.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm extending Exception to implement a setter on the Message property. And this works
I thought I'd use Boost.Interprocess's Message Queue in place of sockets for communication within
for example: @Transactional public boolean addPersonToDb(Person p) { // message on this line //some
I have implemented a message inspector in WCF by implementing IDispatchMessageInspector . Putting a
How to implement a gmail-like this is taking too long warning message using jQuery
I'm trying to implement this accepted solution for displaying a custom error message: https://stackoverflow.com/a/5229581/141172
I had implement this push notification . I tried with push first message, it
I have a tcpip socket interface to a third party software app. I've implemented
I've implemented the JQuery Async Treeview (in APS.NET MVC2) and it works fine, but
I've just implemented SQLCipher in my app to encrypt one fairly simple database. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.