Package org.apache.camel

Examples of org.apache.camel.Message.removeHeader()


        assertEquals("beer", msg.getHeader("bar"));
        assertEquals("beer", msg.getHeader("Bar"));
        assertEquals("beer", msg.getHeader("BAR"));
        assertNull(msg.getHeader("unknown"));

        msg.removeHeader("bar");
        assertNull(msg.getHeader("bar"));
        assertNull(msg.getHeader("unknown"));
    }

    public void testSetWithDifferentCase() {
View Full Code Here


    protected String getTopic(Exchange exchange) {
        Message in = exchange.getIn();
        String topic = in.getHeader(EventAdminConstants.EVENTADMIN_TOPIC, String.class);
        if (topic != null) {
            in.removeHeader(EventAdminConstants.EVENTADMIN_TOPIC);
        }
        if (topic == null) {
            topic = endpoint.getTopic();
        }
        return topic;
View Full Code Here

        assertEquals("bar", msg.getHeader("FOO"));
        assertEquals("bar", msg.getHeader("foo"));
        assertEquals("bar", msg.getHeader("Foo"));

        msg.removeHeader("FOO");

        assertEquals(null, msg.getHeader("foo"));
        assertEquals(null, msg.getHeader("Foo"));
        assertEquals(null, msg.getHeader("FOO"));
View Full Code Here

        assertEquals("bla", msg.getHeader("tick"));
        assertEquals("blaa", msg.getHeader("tack"));
        assertEquals("blaaa", msg.getHeader("tock"));

        msg.removeHeader(null);

        assertFalse(msg.getHeaders().isEmpty());
    }

    public void testRemoveHeaderWithNullValue() {
View Full Code Here

    public void testRemoveHeaderWithNullValue() {
        Message msg = new DefaultMessage();
        assertNull(msg.getHeader("foo"));

        msg.setHeader("tick", null);
        msg.removeHeader("tick");

        assertTrue(msg.getHeaders().isEmpty());
    }

    public void testRemoveHeadersWithWildcard() {
View Full Code Here

        if (invocation == null) {
            throw new IllegalStateException("No method invocation could be created, no matching method could be found on: " + bean);
        }

        // remove headers as they should not be propagated
        in.removeHeader(Exchange.BEAN_MULTI_PARAMETER_ARRAY);
        in.removeHeader(Exchange.BEAN_METHOD_NAME);

        Object value = null;
        try {
            AtomicBoolean sync = new AtomicBoolean(true);
View Full Code Here

            throw new IllegalStateException("No method invocation could be created, no matching method could be found on: " + bean);
        }

        // remove headers as they should not be propagated
        in.removeHeader(Exchange.BEAN_MULTI_PARAMETER_ARRAY);
        in.removeHeader(Exchange.BEAN_METHOD_NAME);

        Object value = null;
        try {
            AtomicBoolean sync = new AtomicBoolean(true);
            value = invocation.proceed(callback, sync);
View Full Code Here

    protected String getTopic(Exchange exchange) {
        Message in = exchange.getIn();
        String topic = in.getHeader(EventAdminConstants.EVENTADMIN_TOPIC, String.class);
        if (topic != null) {
            in.removeHeader(EventAdminConstants.EVENTADMIN_TOPIC);
        }
        if (topic == null) {
            topic = endpoint.getTopic();
        }
        return topic;
View Full Code Here

            exchange.setException(e);
            callback.done(true);
            return true;
        } finally {
            // must remove headers as they were provisional
            in.removeHeader(Exchange.BEAN_MULTI_PARAMETER_ARRAY);
            in.removeHeader(Exchange.BEAN_METHOD_NAME);
        }

        if (invocation == null) {
            exchange.setException(new IllegalStateException("No method invocation could be created, no matching method could be found on: " + bean));
View Full Code Here

            callback.done(true);
            return true;
        } finally {
            // must remove headers as they were provisional
            in.removeHeader(Exchange.BEAN_MULTI_PARAMETER_ARRAY);
            in.removeHeader(Exchange.BEAN_METHOD_NAME);
        }

        if (invocation == null) {
            exchange.setException(new IllegalStateException("No method invocation could be created, no matching method could be found on: " + bean));
            callback.done(true);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.