Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing bundles for camel-amqp #64

Closed
wants to merge 2 commits into from

Conversation

lopushen
Copy link

@lopushen lopushen commented Apr 26, 2024

@lopushen
Copy link
Author

lopushen commented Apr 26, 2024

Tested with

<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.1.0"
           xsi:schemaLocation="
             http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.1.0 http://aries.apache.org/schemas/blueprint-cm/blueprint-cm-1.1.0.xsd
             http://www.osgi.org/xmlns/blueprint/v1.0.0 https://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd
             http://camel.apache.org/schema/blueprint http://camel.apache.org/schema/blueprint/camel-blueprint.xsd">

    <bean id="amqpConnectionDetails" class="org.apache.camel.component.amqp.AMQPConnectionDetails">
        <argument value="amqp://localhost:5672"/>
    </bean>


    <camelContext id="camelContext" xmlns="http://camel.apache.org/schema/blueprint">
        <route id="amqpRoute">
            <from uri="timer://testTimer?fixedRate=true&amp;period=5000"/>
            <setHeader name="theHeader">
                <constant>This is header</constant>
            </setHeader>
            <setBody>
                <constant>Hello Camel</constant>
            </setBody>
            <to uri="amqp:testQueueName"/>
            <log message="Message sent to AMQP: ${body} headers ${header.theHeader}"/>
        </route>

        <route id="amqpRoute2">
            <from uri="amqp:testQueueName"/>
            <log message="Message received from AMQP: ${body} headers ${header.theHeader}"/>
            <choice>
                <when>
                    <simple>${header.theHeader} != "This is header"</simple>
                    <log message="KO - not expected ${header.theHeader}"/>
                    <throwException exceptionType="java.lang.Exception" message="An unexpected header returned"/>
                </when>
                <otherwise>
                    <log message="OK - expected ${header.theHeader}"/>
                    
                </otherwise>
            </choice>
            <choice>
                <when>
                    <simple>${body} != "Hello Camel"</simple>
                    <log message="KO - not expected ${body}"/>
                    <throwException exceptionType="java.lang.Exception" message="An unexpected body returned"/>
                </when>
                <otherwise>
                    <log message="OK - expected ${body}"/>
                </otherwise>
            </choice>
        </route>

    </camelContext>

</blueprint>

Added missing features

@essobedo
Copy link

essobedo commented Apr 26, 2024

Any reason why you only test the producers? I would expect a second route that consumes the messages that you create in the first route

@lopushen
Copy link
Author

Any reason why you only test the producers? I would expect a second route that consumes the messages that you create in the first route

you're right, no reason, should be tested - added a consumer and missing bundles for consumer (it was missing 2 bundles)

@lopushen lopushen closed this May 3, 2024
@lopushen
Copy link
Author

lopushen commented May 3, 2024

The fix was re-visited and implemented in apache#272, closed this one

@f2par0 f2par0 deleted the y.lopushen/camel-amqp branch September 16, 2024 08:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants