camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mattias Severson <>
Subject Camel newbie, endpoint configuration?
Date Thu, 29 Apr 2010 15:54:54 GMT


I have a system that has a handle(long id) interface that I must implement.
My plan is to use this method as a Producer in the camel context:

public class SystemApiImpl {

    public static final String RECIEVER_URL = "some:receiver";

    private final ProducerTemplate producerTemplate;

    public SystemApiImpl(CamelContext camelContext) {
        producerTemplate = camelContext.createProducerTemplate();

    public void handle(long someId) {
        producerTemplate.sendBody(RECIEVER_URL, someId);

Now, I would like to create a unit test that verifies that the RECEIVER_URL
gets the id:

public class SystemApiImplTest {

    private static final long SOME_ID = 42;
    private OutputHandler outputHandler;
    private DefaultCamelContext camelContext;
    private MockEndpoint mockEndpoint;

    public void setUp() throws Exception {
        camelContext = new DefaultCamelContext();
        outputHandler = new OutputHandlerImpl(camelContext);
        mockEndpoint = new MockEndpoint(RECIEVER_URL);
        camelContext.addEndpoint(RECIEVER_URL, mockEndpoint);

    public void testHandle() {
        Exchange exchange = mockEndpoint.getExchanges().get(0);
        Message in = exchange.getIn();
        Long value = in.getBody(Long.class);
        assertEquals(SOME_ID, value.longValue());

However, it seems that I have missed something fundamental, because the
sendBody() method throws an exception:
org.apache.camel.ResolveEndpointFailedException: Failed to resolve endpoint:
fileformat://router due to: No component found with scheme: fileformat 

Please advise,

View this message in context:
Sent from the Camel - Users mailing list archive at

View raw message