If you go through ServiceMix code and look at the examples, you'll see more
examples on how to programmatically create endpoints and start those.  You
need the component, so the way to do that is roughtly:

JBIContainer jbi = new JBIContainer();
jbi.init();
MyComponent cmp = new MyComponent();
MyEndpoint ep = new MyEndpoint();
cmp.setEndpoints(new MyEndpoint[] { ep });
jbi.registerComponent(cmp, "myComponent");
jbi.start();



On Thu, Apr 3, 2008 at 7:08 PM, kai0411 <[EMAIL PROTECTED]> wrote:

>
>
> I'm following the 'Hello World - BC' tutorial from
> http://servicemix.apache.org/hello-world-bc.html.
> Everything works for a provider BC created by this tutorial.
> But I have problems when try to create a consumer BC.
>
> Problem 1. In provider BC, a method processInOut(MessageExchange exchange,
> NormalizedMessage in, NormalizedMessage out) is called, the
> NormalizedMessage 'out' is passed as parameter.
> How do I get NormalizedMessage 'out' in my consumer BC?
>
> Problem 2. In MyconsumerEndpoint.java, super.start() is called in start()
> method.
> I added following code in MySpringComponentTest.java:
>        MyConsumerEndpoint endP = new MyConsumerEndpoint();
>        endP.start();
>
> But got error when I test in JUnit:
> java.lang.NullPointerException
> at
>
> org.apache.servicemix.common.endpoints.ConsumerEndpoint.start(ConsumerEndpoint.java:57)
> [note: line 57 calls ServiceMixComponent component =
> getServiceUnit().getComponent(); in ConsumerEndpoint.start()]
> at
>
> org.apache.servicemix.BCbase.MySpringComponentTest.startRdexServer(MySpringComponentTest.java:77)
> [note: line 47 call super.start(); in MyConsumerEndpoint.start()]
> at
>
> org.apache.servicemix.BCbase.MySpringComponentTest.test(MySpringComponentTest.java:45)
>
> Does anyone have same problem?
>
>
> Problem 3. What changes and configurations I need to make (for instance in
> MySpringComponentTest.java) to test my consumer BC?
>
> Appreciate any suggestions.
>
>
>
>
>
>
>
> --
> View this message in context:
> http://www.nabble.com/HelloWorld-BC-tp16467761p16467828.html
> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>
>


-- 
Cheers,
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/

Reply via email to