You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Mike Oliver <Mi...@open4businessonline.com> on 2021/05/14 04:44:41 UTC

netty4-http client in one bundle and nett4-http server in another

Two contexts.  The first is my client that connects to an endpoint on the
same karaf instance.

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

    <cm:property-placeholder id="camuatomicservice.properties"
        persistent-id="CamuAtomicService" update-strategy="reload">
        <cm:default-properties>
            <cm:property name="camu.api.key"
value="9GC1hnEeNIWVbehmxxjUwkj1Wcx2Y-P7SgOUZvVUzkM"/>
            <cm:property name="camu.protocol" value="http"/>
            <cm:property name="camu.host" value="localhost"/>
            <cm:property name="camu.port" value="8288"/>
            <cm:property name="camu.path" value="external"/>
        </cm:default-properties>
    </cm:property-placeholder>
    <camelContext id="_camuatomicservicecontext" xmlns="
http://camel.apache.org/schema/blueprint">
        <route id="_camuatomicserviceroute1">
            <from id="_from1" uri="direct-vm:camuatomicservice">
                <description>accepts vm messages directly </description>
            </from>
            <log id="_log1" message="Camu Atomic Service body = ${body},
header= ${header.uriPattern}"/>
            <setHeader headerName="api.key" id="_setHeader1">

<constant>"9GC1hnEeNIWVbehmxxjUwkj1Wcx2Y-P7SgOUZvVUzkM"</constant>
            </setHeader>
            <setHeader headerName="CamelHttpPath" id="_setOutHeader1">
                <simple>${header.uriPattern}</simple>
            </setHeader>
            <setHeader headerName="CamelHttpMethod" id="_setHeader2">
                <simple>${header.CamelHttpMethod}</simple>
            </setHeader>
            <to id="_to1" pattern="InOut"
uri="netty4-http:{{camu.protocol}}:{{camu.host}}:{{camu.port}}/{{camu.path}}"/>
            <log id="_log2" message="CamuAtomicService Response body
${body}"/>
        </route>
    </camelContext>
</blueprint>

I am dynamically setting the method and path from my Facade contexts. (not
shown and not relevant really).
I have a mockup of an external service that will eventually be the
production environment.  So the client and server (or consumer and
producer) are both using netty4-http on same localhost and port and root
path.

This CamuMock doesn't want to load and the log doesn't say much on why.
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
    xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="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
https://camel.apache.org/schema/blueprint/camel-blueprint.xsd">
    <bean class="ph.edu.dlsu.esb.CogMockProcessor" id="CogMockProcessor"/>
    <camelContext id="_camumockcontext" xmlns="
http://camel.apache.org/schema/blueprint">
        <route id="_camumockroute1">
            <from id="_from1"
uri="netty4-http:http:localhost:8288/external?matchOnUriPrefix=true">
                <description>Mock the Camu API</description>
            </from>
            <process id="_process1" ref="CogMockProcessor"/>
            <log id="_log1" message="Made it here CamuMock
${header.CamelHttpMethod},  ${header.uriPattern} and CamelHttpPath header
${header.CamelHttpPath}"/>
        </route>
    </camelContext>
</blueprint>
is there a setting for nett4-http I am missing on CamuMock?
And if not too much for one question, how can I get more verbose on the
karaf console log?




*Mike Oliver** Founder**, Open 4 Business Online*
Tel: +1(951)260-0793 | Mobile:**NEW* 639479927462
US Toll free: 1-800-985-4766 **NEW*
http://www.o4bo.com
Mas marunong akong umunawa ng salitang tagalog kaysa magkapagsalita nito
[image: Facebook]
<http://www.facebook.com/pages/Open-4-Business-Online/147285608707176> [image:
Twitter] <https://twitter.com/O4BO> [image: LinkedIn]
<http://ph.linkedin.com/pub/mike-oliver/0/1b9/197> [image: AngelList]
<https://angel.co/open-4-business-online/> [image: Blogger]
<http://blog.open4businessonline.com/> [image: eBay]
<http://www.store.o4bo.com/servlet/StoreFront> [image: YouTube]
<http://www.youtube.com/channel/UCruaIEFosh9uvfkQCq7mtKw> [image: Google
Plus Page] <https://plus.google.com/113688478700619104336/posts>
Contact me: [image: Google Talk] mikeoliveraz@open4businessonline.com [image:
Skype] MikeOliverAZ