camel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christian Müller (JIRA) <j...@apache.org>
Subject [jira] Commented: (CAMEL-3468) New camel-aws component
Date Thu, 30 Dec 2010 22:15:46 GMT

    [ https://issues.apache.org/jira/browse/CAMEL-3468?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12976123#action_12976123
] 

Christian Müller commented on CAMEL-3468:
-----------------------------------------

Hello Tracy,
today I had a first look at this new component. It looks good and I think a cool contribution.
However, I will make some little changes. ;-)
I also made an integration test to verify this component works as expected. At present it
fails, but I think i get it working the next few days, hopefully before Hadrian cut the 2.6.
release...

{code}
public class SqsComponentIntegrationTest extends CamelTestSupport {
    
    @EndpointInject(uri = "direct:start")
    private ProducerTemplate template;
    
    @EndpointInject(uri = "mock:result")
    private MockEndpoint result;
    
    @Test
    //@Ignore("Must be manually tested")
    public void sendInOnly() throws Exception {
        result.expectedMessageCount(1);
        
        Exchange exchange = template.send("direct:start", ExchangePattern.InOnly, new Processor()
{
            public void process(Exchange exchange) throws Exception {
                exchange.getIn().setBody("This is my message text.");
            }
        });
        
        assertMockEndpointsSatisfied();
        
        Exchange resultExchange = result.getExchanges().get(0);
        assertEquals("This is my message text.", resultExchange.getIn().getBody());
        assertNotNull(resultExchange.getIn().getHeader(SqsBinding.MESSAGE_ID));
        assertNotNull(resultExchange.getIn().getHeader(SqsBinding.RECEIPT_HANDLE));
        assertEquals("6a1559560f67c5e7a7d5d838bf0272ee", resultExchange.getIn().getHeader(SqsBinding.MD5_OF_BODY));
        
        assertNotNull(exchange.getIn().getHeader(SqsBinding.MESSAGE_ID));
        assertEquals("6a1559560f67c5e7a7d5d838bf0272ee", resultExchange.getIn().getHeader(SqsBinding.MD5_OF_BODY));
    }
    
    @Test
    //@Ignore("Must be manually tested")
    public void sendInOut() throws Exception {
        result.expectedMessageCount(1);
        
        Exchange exchange = template.send("direct:start", ExchangePattern.InOut, new Processor()
{
            public void process(Exchange exchange) throws Exception {
                exchange.getIn().setBody("This is my message text.");
            }
        });
        
        assertMockEndpointsSatisfied();
        
        Exchange resultExchange = result.getExchanges().get(0);
        assertEquals("This is my message text.", resultExchange.getIn().getBody());
        assertNotNull(resultExchange.getIn().getHeader(SqsBinding.RECEIPT_HANDLE));
        assertNotNull(resultExchange.getIn().getHeader(SqsBinding.MESSAGE_ID));
        assertEquals("6a1559560f67c5e7a7d5d838bf0272ee", resultExchange.getIn().getHeader(SqsBinding.MD5_OF_BODY));
        
        assertNotNull(exchange.getOut().getHeader(SqsBinding.MESSAGE_ID));
        assertEquals("6a1559560f67c5e7a7d5d838bf0272ee", resultExchange.getOut().getHeader(SqsBinding.MD5_OF_BODY));
    }
    
    protected RouteBuilder createRouteBuilder() throws Exception {
        return new RouteBuilder() {
            @Override
            public void configure() throws Exception {
                from("direct:start")
                    .to("sqs://MyQueue?accessKey=xxx&secretKey=yyy");
                
                from("sqs://MyQueue?accessKey=xxx&secretKey=yyy")
                    .to("mock:result");
            }
        };
    }
}
{code}

> New camel-aws component
> -----------------------
>
>                 Key: CAMEL-3468
>                 URL: https://issues.apache.org/jira/browse/CAMEL-3468
>             Project: Camel
>          Issue Type: New Feature
>            Reporter: Tracy Snell
>            Assignee: Christian Müller
>         Attachments: patchfile.txt
>
>
> I've started a new component to interface with Amazon Web Services. This first pass includes
just a Simple Queue Service component. Additional services will be added soon. I used the
Amazon AWS SDK for Java to interface with AWS. Uses Apache 2.0 as it's license.
> Let me know if I need to change things or any thoughts/suggestions and I'll be glad to
make the adjustments.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message