Package org.springframework.integration

Examples of org.springframework.integration.MessageHeaders


                return message;
            }
        }

        // Create a new spring message and copy the attributes and body from the camel message
        MessageHeaders messageHeaders = new MessageHeaders(camelMessage.getHeaders());
        return new GenericMessage(camelMessage.getBody(), messageHeaders);
    }
View Full Code Here


                return message;
            }
        }

        // Create a new spring message and copy the attributes and body from the camel message
        MessageHeaders messageHeaders = new MessageHeaders(camelMessage.getHeaders());
        return new GenericMessage<Object>(camelMessage.getBody(), messageHeaders);
    }
View Full Code Here

                return message;
            }
        }

        // Create a new spring message and copy the attributes and body from the camel message
        MessageHeaders messageHeaders = new MessageHeaders(camelMessage.getHeaders());
        return new GenericMessage(camelMessage.getBody(), messageHeaders);
    }
View Full Code Here

        assertEquals("Mismatched type", type, op.getType());

        assertEquals("Mismatched component type", compType, op.get("siComponentType", String.class));
        assertEquals("Mismatched bean name", beanName, op.get("beanName", String.class));

        MessageHeaders hdrs = message.getHeaders();
        UUID msgId = hdrs.getId();
        assertEquals("Mismatched message id", msgId.toString(), op.get("idHeader", String.class));
        assertEquals("Mismatched payload type", "java.lang.String", op.get("payloadType", String.class));

        return op;
    }
View Full Code Here

    }
    return parts;
  }

  public Map<String, Object> signMessageHeaders(Message<?> message) {
    MessageHeaders headers = message.getHeaders();
    String url = headers.get(SignatureHelper.URL_X_HEADER, String.class);

    Map<String, Object> newheaders = new HashMap<String, Object>();
    newheaders.put("Accept", "*/*");
    newheaders.put(SignatureHelper.URL_X_HEADER, url);
    newheaders.put(SignatureHelper.USER_HEADER, "notification");
    newheaders.put(SignatureHelper.TIMESTAMP_HEADER, "\"" + System.currentTimeMillis() + "\"");

    //sign only those headers that are Strings
    Map<String, List<String>> stringHeaders = new HashMap<String, List<String>>();
    for (String key : headers.keySet()) {
      if (headers.get(key) instanceof String) {
        List<String> ss = new ArrayList<String>();
        ss.add(headers.get(key, String.class));
        stringHeaders.put(key, ss);
      }
      newheaders.put(key, headers.get(key));
    }

    try {
      log.debug("HEADERS -> " + stringHeaders + ":" + url + ":" + "notification");

View Full Code Here

  public void test_from_headers_mapping(Flag flag, String value) {
    DefaultJGroupsHeaderMapper headerMapper = new DefaultJGroupsHeaderMapper();

    Map<String, Object> map = new HashMap<String, Object>();
    map.put(value, true);
    MessageHeaders headers = new MessageHeaders(map);

    Message target = new Message();
    headerMapper.fromHeaders(headers, target);

    assertThat(target.isFlagSet(flag));
View Full Code Here

  public void testReply() {
    JobParametersBuilder builder = new JobParametersBuilder();
    builder.addString("dontclash", "12");
    Map<String, Object> map = new HashMap<String, Object>();
    map.put(MessageHeaders.REPLY_CHANNEL, "response");
    MessageHeaders headers = new MessageHeaders(map);
    GenericMessage<JobLaunchRequest> trigger = new GenericMessage<JobLaunchRequest>(new JobLaunchRequest(job,
        builder.toJobParameters()), headers);
    requestChannel.send(trigger);
    Message<JobExecution> executionMessage = (Message<JobExecution>) responseChannel.receive(1000);
View Full Code Here

  public void testReply() {
    JobParametersBuilder builder = new JobParametersBuilder();
    builder.addString("dontclash", "12");
    Map<String, Object> map = new HashMap<String, Object>();
    map.put(MessageHeaders.REPLY_CHANNEL, "response");
    MessageHeaders headers = new MessageHeaders(map);
    GenericMessage<JobLaunchRequest> trigger = new GenericMessage<JobLaunchRequest>(new JobLaunchRequest(job,
        builder.toJobParameters()), headers);
    requestChannel.send(trigger);
    Message<JobExecution> executionMessage = (Message<JobExecution>) responseChannel.receive(1000);
View Full Code Here

    JobParametersBuilder builder = new JobParametersBuilder();
    builder.addString("dontclash", "12");
    Map<String, Object> map = new HashMap<String, Object>();
    map.put(MessageHeaders.REPLY_CHANNEL, "response");
    MessageHeaders headers = new MessageHeaders(map);
    GenericMessage<JobLaunchRequest> trigger = new GenericMessage<JobLaunchRequest>(new JobLaunchRequest(testJob,
        builder.toJobParameters()), headers);
    requestChannel.send(trigger);

    Message<JobExecution> executionMessage = (Message<JobExecution>) responseChannel.receive(1000);
View Full Code Here

TOP

Related Classes of org.springframework.integration.MessageHeaders

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.