camel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Charles Moulliard <cmoulli...@gmail.com>
Subject Re: [Question about] - New camel quickfix component
Date Fri, 08 May 2009 09:46:32 GMT
Willem,

Any idea how to avoid to declare the beans in the spring xml file ?

      <bean id="quickfix-server"
class="org.apache.camel.component.quickfix.QuickfixAcceptor"/>
        <bean id="quickfix-client"
class="org.apache.camel.component.quickfix.QuickfixInitiator"/>


    <camel:camelContext trace="true" xmlns="
http://camel.apache.org/schema/osgi">
        <camel:route>
            <camel:from uri="quickfix-server:META-INF/examples/server.cfg"/>
            <camel:to uri="quickfix-client:META-INF/examples/client.cfg"/>
        </camel:route>
    </camel:camelContext>

Normally, these classes should be instantiated by the camel endpoint (is is
correct what I say or I'm completely stupid) ?

Regards,

Charles Moulliard
Senior Enterprise Architect
Apache Camel Committer

*****************************
blog : http://cmoulliard.blogspot.com


On Fri, May 8, 2009 at 11:28 AM, Charles Moulliard <cmoulliard@gmail.com>wrote:

> Something like the CXF component can do with its DataFormat type?
> ?dataFormat=String
> ?dataFormat=QuickFixMessage
>
> I will check what is implemented in the camel-cxf component.
> *Are you looking for another camel feedback concerning your proposal ?*
>
> But why are you setting both the IN and OUT to the same message?
> Good question. Anton is the author so I can't reply BUT
> In quickfix, the application (
> http://www.quickfixj.org/quickfixj/usermanual/usage/application.html)
> which is the engine communicating with a FIX server can be of type ACCEPTOR
> or INITIATOR. You have to both configure the two applications because the
> engine is not a client/server application. In one case, you accept incoming
> messages and in the other you generate the messages. The camel-quickfix does
> not know which role it plays because it is defined in the config.file
> provided as input to the quickFixAcceptor or quickFixInitiator class. These
> two classes call the same QuickFixEndpoint.
> *
> Maybe the class has to be splitted in two endpoints, one corresponding to
> each to avoid both IN/OUT ???*
>
> Regards,
>
> Charles Moulliard
> Senior Enterprise Architect
> Apache Camel Committer
>
> *****************************
> blog : http://cmoulliard.blogspot.com
>
>
> On Fri, May 8, 2009 at 9:52 AM, Claus Ibsen <claus.ibsen@gmail.com> wrote:
>
>> On Fri, May 8, 2009 at 9:31 AM, Charles Moulliard <cmoulliard@gmail.com>
>> wrote:
>> > Hi,
>> >
>> > Is it possible through camel endpoint, producer, consumer, ... (I don't
>> know
>> > exactly where in camel class), to parameter the output that we would
>> like to
>> > have from a component/endpoint ?
>> >
>> > In the camel-quickfix component, the FIX server implemented (through
>> > quickFix classes) receives messages in the FIX format and map the
>> content
>> > into a quickfix.Message (can be of type quickfix, FIX40, quickfix.FIX41,
>> > ...).
>> >
>> > What I would like to do is have the possibility through the Camel
>> endpoint
>> > to tell to the component that I want to receive the FIX messages mapped
>> or
>> > not ?
>> >
>> > e.g. From("quickfixserver?type=String") or
>> > From("quickfixserver?type=quickFix.Message")
>> Something like the CXF component can do with its DataFormat type?
>> ?dataFormat=String
>> ?dataFormat=QuickFixMessage
>>
>> And it should default to QuickFixMessage
>>
>>
>> >
>> > By analysing the code, I have discovered that the method : receive as
>> > parameter the  quickFix.Message
>> >
>> > What is the best approach to implement this in the endpoint ?
>> >
>> > 1) Create 2 createExchange(Message message) createExchange(String
>> string)
>> >
>> > or change the existing to let the consumer/producer to return a
>> > String/Message/XML/....
>> >
>> > Here is a snapshot of the code :
>> >
>> >    public void onMessage(Message message) {
>> >        Exchange exchange = createExchange(message);
>> >        try {
>> >            processor.process(exchange);
>> >        } catch (Exception e) {
>> >            exchange.setException(e);
>> >        }
>> >
>> >    }
>> >
>> >    public Exchange createExchange(Message message) {
>> >        setExchangePattern(ExchangePattern.InOut);
>> >        Exchange answer = createExchange();
>> >        answer.getIn().setBody(message);
>> >        answer.getOut().setBody(message);
>> >        return answer;
>> Here is a good spot. You can usually get the endpoint and ask which
>> dataFormat it was configued with.
>> Then you know if its a String or QuickFix message you should set as Body.
>>
>> But why are you setting both the IN and OUT to the same message?
>> Usually it is only IN you set.
>>
>>
>> >    }
>> >
>> >    // for initiator
>> >    public Producer createProducer() throws Exception {
>> >        return new QuickfixProducer(this);
>> >    }
>> >
>> >    // for acceptor
>> >    public Consumer createConsumer(Processor processor) throws Exception
>> {
>> >        this.processor = processor;
>> >        return new QuickfixConsumer(this, processor);
>> >    }
>> >
>> > Regards,
>> >
>> > Charles Moulliard
>> > Senior Enterprise Architect
>> > Apache Camel Committer
>> >
>> > *****************************
>> > blog : http://cmoulliard.blogspot.com
>> >
>>
>>
>>
>> --
>> Claus Ibsen
>> Apache Camel Committer
>>
>> Open Source Integration: http://fusesource.com
>> Blog: http://davsclaus.blogspot.com/
>> Twitter: http://twitter.com/davsclaus
>> Apache Camel Reference Card:
>> http://refcardz.dzone.com/refcardz/enterprise-integration
>> Interview with me:
>>
>> http://architects.dzone.com/articles/interview-claus-ibsen-about?mz=7893-progress
>>
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message