I just worked a bit more on the component and reactive streams prototype to split it up into bundles and also make the MComponent interface a bit simpler:

https://github.com/cschneider/streaming-osgi

In the MComponent interface I exchanged the converter with a target type. This makes it easier to use.

public interface MComponent {
    <T> Publisher<T> from(String destination, Class<? extends T> type);
    <T> Subscriber<T> to(String destination, Class<? extends T> type);
}

At the moment there is no conversion. Every component has a native type that you must use. For example the Mqtt component uses the type byte[], EventAdmin uses Map<String,?>. As an enhancement we can use the ConverterService to convert from the native type to a target type.

Currently destination is just used for things like a topic but it could be used like in camel and also allow to override settings.

So one interesting question is .. Can a component interface stay this simple or are we missing some essential features.
One thing is that messaging often supports properties like jms properties.
Not sure how to handle these but I would like to avoid the very generic message model of camel that completely defeats any type safety which is an important part of streams.

I would be happy about any suggestions for improvements and other feedback.

Best

Christian

--
Christian Schneider
http://www.liquid-reality.de

Open Source Architect
http://www.talend.com

Reply via email to