Ok, that sounds promising.
Which is the base poller component to extend?
Also, a generic DB component that supported the kind of behaviour I'm
looking for would be quite hard to do since I need to get data from 2 (or
more)tables into one transaction. Generalising this use case would lead to
creating a way to handle this. Maybe I havent looked carefully at the
ServiceMix documentation but I don't think it supports something like that,
i.e. having 2 startpoints , having the data from both accessible within a
"transaction" but only one of them responsible for the flow.
For example, in the case I mentioned, I think it would look something like
this: (btw, I'm not that familiar with ServiceMix so I hope what I'm saying
makes sense)
Similar to the file-binding example in the documentation, instead of having
a single component as the provider (getOrders) we would have something like
getOrders and getOrderItems.
Both poll the DB continuously, but the getOrderItems "messages" stay in the
NMR until the relevant getOrders item has reached it at which point a new
composite message is built from those 2 sets of data (like the complete
order as it would have been in the file in that example) and sent to the
placeOrders component.
Also, rather than a SELECT Count(*) etc. I think it should be more like
define the query, define the no of rows per event (do we handle 1 at a time
even if there are more? all of them? a specific amount? etc.) and define
which field is the primary key and use that to poll the DB
Any thoughts? Am I completely mistaken on what ServiceMix can do?
bsnyder wrote:
>
> On 3/21/07, Alex_ynr <[EMAIL PROTECTED]> wrote:
>>
>> I am working on a project and I have a rough layout of what the comms
>> part of
>> it should be like. The following is a very simplified example of it but I
>> just wanna know whether it can be done with ServiceMix (and ActiveMQ)...
>>
>> I have a DB server with, say, 2 tables, an Orders table and an
>> Order_Items
>> table.
>>
>> I want to poll the Orders table for new orders, if there is one, get the
>> associated order_items, build a message containing the order details and
>> items and publish it to activemq. Then, on the other side, subscribe to
>> activemq, get the message and write a file to the filesystem containing
>> the
>> information in the message in a specific format.
>>
>> The actual transactions are more complicated than this and there is more
>> than one but that is the general idea. I just wanna know whether it can
>> be
>> done or if it's not worth the effort etc.
>>
>> Please note that although I can program/understand Java, it's not my
>> primary
>> development language so maybe it's a silly question.
>>
>> I've developed a similar system in the past but I was using a proprietary
>> messaging and ESB solution that supported such a topology...
>
> Yes, ServiceMix can handle this topology. The only pieces that it
> doesn't currently offer are a database component and a database
> poller.
>
> Creating a database poller should be fairly simple because ServiceMix
> already has a base poller and we can just extend it. I'm thinking that
> it would perform a select count(*) from <table> and if the result
> comes back greater than 0, then the rest of the flow is triggered.
>
> Creating a database component that is generically usable would be a
> bit more work, but this is certainly achievable.
>
> We can help you create both of these if you can work with us on the
> use case. I've wanted to create each of these for some time now, but I
> just haven't had a chance.
>
> Bruce
> --
> perl -e 'print
> unpack("u30","D0G)[EMAIL PROTECTED]&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
> );'
>
> Apache Geronimo - http://geronimo.apache.org/
> Apache ActiveMQ - http://activemq.org/
> Apache ServiceMix - http://servicemix.org/
> Castor - http://castor.org/
>
>
--
View this message in context:
http://www.nabble.com/Question-about-ServiceMix-topologies-tf3439529s12049.html#a9611190
Sent from the ServiceMix - User mailing list archive at Nabble.com.