Small correction;

On Sun, Dec 22, 2013 at 6:01 PM, Nirmal Fernando <[email protected]> wrote:

> Guys,
>
> Am I wrong to think like below?
>
>                             JMS over AMQP conn.
>          AMQP
> CEP --> JMS API ------------------------------------> *Message Broker*
> <--------------- JMS Client/ non-Java based AMQP client
>
> AMQP = could be replaced by any other wire protocol
>
> JMS API doesn't depend on the underlying protocol and since CEP is java,
> it has implemented the JMSOutputAdapter using JMS API. But in this case the
> message actually written by CEP to the wire is AMQP message.
>

I think the mapping from JMS message to AMQP is done at the Message Broker
end. So, CEP writes a JMS message through a AMQP connection to the message
broker.

http://activemq.apache.org/amqp.html


> IMO currently it's a limitation of CEP's JMS output adapter that it
> doesn't allow users to specify JMS properties/headers.
>
> What am I missing?
>
>
>
> On Sun, Dec 22, 2013 at 5:17 PM, Mohanadarshan Vivekanandalingam <
> [email protected]> wrote:
>
>> Hi Imesh,
>>
>> Based on the information that you given, there are two ways to implement
>> this which discussed in this thread.
>>
>> 1) Patching the old JMS adaptor to support user defined AMQP properties
>>
>> 2) Writing a new output event adaptor which support for your usecase.
>>
>> IMHO, as you said better to write a new adaptor (option 2) which matches
>> for usecase since it is clean and more flexible rather than patching the
>> jms adaptor. As you mentioned you can re-use jms implementation to achieve
>> your task.
>>
>> You can follow the link [1] to write a custom event adaptor.
>>
>> [1]
>> http://wso2.com/library/articles/2013/08/writing-custom-event-adaptors-for-cep-3.0.0/
>>
>> Thanks & Regards,
>> Mohan
>>
>>
>>
>> On Sun, Dec 22, 2013 at 5:00 PM, Imesh Gunaratne <[email protected]> wrote:
>>
>>> Hi,
>>>
>>> Thanks Lasantha for your feedback.
>>>
>>> No, there won't be any processing happening in CEP based on the AMQP
>>> properties. The idea is to support the AMQP protocol when writing from CEP
>>> to the message consumer. As a result AMQP properties could be included in
>>> messages using event formatters.
>>>
>>> Nirmal, the reason why I proposed to implement a new adapter is that JMS
>>> and AMQP would mean two different things (as you have mentioned) in the
>>> context of messaging:
>>>
>>>    - JMS is a standard* messaging API for Java platform*
>>>    - AMQP is a specification which provides a *standard messaging
>>>    protocol across all platforms*.
>>>
>>> Therefore I think an AMQP Output Adapter would provide a much clear view
>>> and add more value to CEP when communicating with AMQP based, non Java
>>> message consumers.
>>>
>>> Yes as I have pointed out earlier the idea is to implement the AMQP
>>> Output Adapter by re-using the features in JMS Output Adapter.
>>>
>>> Thanks
>>>
>>>
>>>
>>> On Sun, Dec 22, 2013 at 1:18 PM, Lasantha Fernando <[email protected]>wrote:
>>>
>>>> Hi Imesh,
>>>>
>>>> +1 for implementing an AMQP output adapter. I think it will be very
>>>> useful to add it as a supported adapter type for CEP.
>>>>
>>>> Will there be any processing happening based on the AMQP properties
>>>> within the CEP? Or is it simply that an AMQP message needs to be sent with
>>>> properties to the AMQP based broker?
>>>>
>>>> Thanks,
>>>> Lasantha
>>>>
>>>>
>>>> On 22 December 2013 10:34, Imesh Gunaratne <[email protected]> wrote:
>>>>
>>>>> Hi All,
>>>>>
>>>>> In Apache Stratos (incubating) 4.0.0 we are using WSO2 CEP for
>>>>> aggregating statistics events sent by load balancers and cartridge agents
>>>>> (agents in VM instances). The aggregated values are used by the Autoscaler
>>>>> for taking autoscaling decisions.
>>>>>
>>>>> Here the events are sent to CEP using the default input adapter (via
>>>>> Thrift) and the aggregated events are sent to an AMQP based message broker
>>>>> using the JMS Output Adapter. Event formatters have been used for defining
>>>>> the formats of the output messages.
>>>>>
>>>>> *A Sample Event Formatter:*
>>>>> <?xml version="1.0" encoding="UTF-8"?>
>>>>> <eventFormatter name="AverageRequestsInflightEventFormatter"
>>>>>   statistics="disable" trace="enable" xmlns="
>>>>> http://wso2.org/carbon/eventformatter";>
>>>>>   <from streamName="average_in_flight_requests" version="1.0.0"/>
>>>>>   <mapping customMapping="enable" type="json">
>>>>>
>>>>> <inline>{"average_in_flight_requests":{"cluster_id":"{{cluster_id}}","network_partition_id":"{{network_partition_id}}","value":"{{count}}"}}</inline>
>>>>>   </mapping>
>>>>>   <to eventAdaptorName="JMSOutputAdaptor" eventAdaptorType="jms">
>>>>>     <property
>>>>> name="transport.jms.Destination">summarized-health-stats</property>
>>>>>   </to>
>>>>> </eventFormatter>
>>>>>
>>>>> The above is a sample event formatter which defines an aggregated
>>>>> event. Similarly there is a collection of events sent by CEP to the 
>>>>> message
>>>>> broker. For each event there is an event formatter defined.
>>>>>
>>>>>
>>>>> *The Requirement:*
>>>>> Here there is a requirement to include a set of AMQP Properties [1] in
>>>>> the output message. These properties may include name value pairs specific
>>>>> for each event:
>>>>>
>>>>> *A Sample AMQP Message*
>>>>> Message Properties:
>>>>>
>>>>> event_class_name: 
>>>>> org.apache.stratos.messaging.event.health.stat.AverageInFlightRequests
>>>>>
>>>>> Message Body:
>>>>>
>>>>> {"average_in_flight_requests":{"cluster_id":"{{cluster_id}}","network_partition_id":"{{network_partition_id}}","value":"{{count}}"}}
>>>>>
>>>>>
>>>>> *The Proposal:*
>>>>> As I understood this functionality is not supported by the JMS Output
>>>>> Adapter at the moment and I think it's logical since AMQP features should
>>>>> not be included in JMS Output Adapter.
>>>>>
>>>>> As a solution to this requirement I would like to implement an AMQP
>>>>> Output Adapter on top of the JMS Output Adapter to support this
>>>>> functionality [2]. I will send more implementation design details in
>>>>> another mail as I progress.
>>>>>
>>>>> Really appreciate your thoughts on this.
>>>>>
>>>>> [1]
>>>>> http://en.wikipedia.org/wiki/Advanced_Message_Queuing_Protocol#Message_format
>>>>> [2] http://docs.wso2.org/display/CEP300/Output+Event+Adaptors
>>>>>
>>>>>
>>>>> Many Thanks
>>>>> --
>>>>> *Imesh Gunaratne*
>>>>> Technical Lead
>>>>> WSO2 Inc: http://wso2.com
>>>>> T: +94 11 214 5345 M: +94 77 374 2057
>>>>> W: http://imesh.gunaratne.org
>>>>> Lean . Enterprise . Middleware
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> Architecture mailing list
>>>>> [email protected]
>>>>> https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture
>>>>>
>>>>>
>>>>
>>>>
>>>> --
>>>> *Lasantha Fernando*
>>>> Software Engineer - Data Technologies Team
>>>> WSO2 Inc. http://wso2.com
>>>>
>>>> email: [email protected]
>>>> mobile: (+94) 71 5247551
>>>>
>>>> _______________________________________________
>>>> Architecture mailing list
>>>> [email protected]
>>>> https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture
>>>>
>>>>
>>>
>>>
>>> --
>>> *Imesh Gunaratne*
>>> Technical Lead
>>> WSO2 Inc: http://wso2.com
>>> T: +94 11 214 5345 M: +94 77 374 2057
>>> W: http://imesh.gunaratne.org
>>> Lean . Enterprise . Middleware
>>>
>>>
>>> _______________________________________________
>>> Architecture mailing list
>>> [email protected]
>>> https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture
>>>
>>>
>>
>>
>> --
>> *V. Mohanadarshan*
>> *Software Engineer,*
>> *Data Technologies Team,*
>> *WSO2, Inc. http://wso2.com <http://wso2.com> *
>> *lean.enterprise.middleware.*
>>
>> email: [email protected]
>> phone:(+94) 771117673
>>
>> _______________________________________________
>> Architecture mailing list
>> [email protected]
>> https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture
>>
>>
>
>
> --
>
> Thanks & regards,
> Nirmal
>
> Senior Software Engineer- Platform Technologies Team, WSO2 Inc.
> Mobile: +94715779733
> Blog: http://nirmalfdo.blogspot.com/
>
>


-- 

Thanks & regards,
Nirmal

Senior Software Engineer- Platform Technologies Team, WSO2 Inc.
Mobile: +94715779733
Blog: http://nirmalfdo.blogspot.com/
_______________________________________________
Architecture mailing list
[email protected]
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture

Reply via email to