WSO2 CEP output event adaptor error - wso2

I am new to WSO2 CEP
I have created the entire flow to read the JMS message and split it using Text formatter. The problem is that when I try to push messages into the queue, it is not able to reach the the output event adaptor. I have a mysql event adaptor and configured it into my event formatter but I keep getting the below message in my log
[2014-02-13 21:20:06,347] ERROR - {ReceiverGroup} No receiver is reachable at reconnection, can't publish the events
[2014-02-13 21:20:06,352] ERROR - {AsyncDataPublisher} Reconnection failed for for tcp://localhost:7661
Can someone help me understand what is this tcp://localhost:7661 is all about
Regards
Subbu

tcp://localhost:7661 is the default port to which Thrift(WSO2 events are published). It seems a default event formatter has been created and trying to publish events to that port.
Can you check your list of event formatters and ensure that no event formatters of type WSO2Event are created. This event formatter might be automatically created if you set an exported stream to be 'pass-through' when creating the execution plan.
You can enable event tracing[1] and monitor to determine exactly upto which point the event is coming in your configured flow.
[1] http://docs.wso2.org/display/CEP300/CEP+Event+Tracer
HTH,
Lasantha

Related

Ability to ensure message was successfully sent to Event Hub from APIM

Is it possible to ensure that a message was successfully delivered to an Event Hub when sending it with the log-to-eventhub policy in API Management?
Edit: In our solution we cannot allow any request to proceed if a message was not delivered to the Event Hub. As far as I can tell the log-to-eventhub policy doesn't check for this.
Welcome to Stackoveflow!
Note: Once the data has been passed to an Event Hub, it is persisted and will wait for Event Hub consumers to process it. The Event Hub does not care how it is processed; it just cares about making sure the message will be successfully delivered.
For more details, refer “Why send to an Azure Event Hub?”.
Hope this helps.
Event Hubs is built on top of Service Bus. According to the Service Bus documentation,
Using any of the supported Service Bus API clients, send operations into Service Bus are always explicitly settled, meaning that the API operation waits for an acceptance result from Service Bus to arrive, and then completes the send operation.
If the message is rejected by Service Bus, the rejection contains an error indicator and text with a "tracking-id" inside of it. The rejection also includes information about whether the operation can be retried with any expectation of success. In the client, this information is turned into an exception and raised to the caller of the send operation. If the message has been accepted, the operation silently completes.
When using the AMQP protocol, which is the exclusive protocol for the .NET Standard client and the Java client and which is an option for the .NET Framework client, message transfers and settlements are pipelined and completely asynchronous, and it is recommended that you use the asynchronous programming model API variants.
A sender can put several messages on the wire in rapid succession without having to wait for each message to be acknowledged, as would otherwise be the case with the SBMP protocol or with HTTP 1.1. Those asynchronous send operations complete as the respective messages are accepted and stored, on partitioned entities or when send operation to different entities overlap. The completions might also occur out of the original send order.
I think this means the SDK is getting a receipt for each message.
This theory is further aided by the RetryPolicy Class used in the ClientEntity.RetryPolicy Property of the EventHubSender Class.
In the API Management section on logging-to-eventhub, there is also a section on retry intervals. Below that are sections on modifying the return response or taking action on certain status codes.
Once the status codes of a failed logging attempt are known, you can modify the policies to take action on failed logging attempts.

WSO2: MQTT input event adapter is not listening

I am using WSO2 CEP 4.2.0 and have created MQTT input event adapter. I have also created the receiver which will receive the data from a external topic and then using streams, I am adding some logics and then same message will be published using publishers to another external topic.
Now, When I restart the application, I get below two messages:
INFO {org.wso2.carbon.event.input.adapter.core.internal.InputAdapterRuntime} - Connecting receiver mqttreceiver_test
INFO {org.wso2.carbon.event.input.adapter.mqtt.internal.util.MQTTAdapterListener} - MQTT Connection successful
And then When I am publishing the message from external mqtt client, I can see that message arrives the event receiver and after stream processing, the message goes to output event publisher.
But after approx 5 mins, the messages are not received any more in the event receiver. I do not get any error message also in logs but what I could sense is may be the input adapter is not listening any more.
Any suggestions or any guidance will help.
Thanks
Few things I could suggest to debug this issue:
Perhaps the flow is broken so that the event does not reach the
output event publisher? You could use logger event publisher [1] and log
the stream that is generated by the MQTT input event adapter.
Enable debug logs for package
org.wso2.carbon.event.input.adapter.mqtt.internal.util so that you
will see a log when the MQTTAdapterListener receives a message (See
[2] ). You can follow [3] to enable debug logs.
When the issue
happens, take a thread dump and see whether the MQTTAdapterListener
thread is running.
Hope these will help you to narrow down the issue.
[1] https://docs.wso2.com/display/CEP420/Logger+Event+Publisher
[2] https://github.com/wso2/carbon-analytics-common/blob/v5.1.3/components/event-receiver/event-input-adapters/org.wso2.carbon.event.input.adapter.mqtt/src/main/java/org/wso2/carbon/event/input/adapter/mqtt/internal/util/MQTTAdapterListener.java#L150
[3] https://docs.wso2.com/display/CEP420/Logging

Event hub Handling receiver error for single event failure

is there a way for event hub listener to retry only the single failed event, or i have to fail the full batch
the listener gets a list of events and checkpoint will move pointer fwd. for full batch.
There is no good way to replay Events using EventProcessorHost. User is expected to handle the failures in user code (ProcessEvents code).
If there is a poison event in the system and the EventProcessorHost cannot proceed to execute and want to bail out - the only way to achieve this is to checkpoint until a known good Event and unregister the EventProcessorHost or kill the process.
You can control until which exact event you want to checkpoint using the PartitionContext.Checkpoint(EventData) API.

wso2 cep error while create a event receiver kafka type

It is successful to create the event receiver type kafka in the first time.
however the second , when I run the kafka again and create a new event receiver from wso2 cep .
It show the message as below
"Failed to add event receiver, Exception: java.lang.NoClassDefFoundError: org/apache/kafka/common/security/JaasUtils"
and failed to add the new event receiver.
How should I handle that cases?
If you want to set kafka event receiver you need to configure some prerequisites. You need to add some dependency jar files to set kafka event receiver. you can refer this doc for more details.

How to use wso2cep in my case?

I am working with wso2cep3.0. I went through the docs of wso2cep but there is no exaplanation about wso2cep how would i use it
1.what is the use of Input Event Adapter:-in my concern for getting the data from client.
2.Event Builder means incoming data format specifier.
3.Event Formatter means Outgoing data format specifier.
4.Output Event Adapter out put handler.
but how can i use this thing means any program or any event writer most important how would i publish this to external world example as http endpoint or https or jms.
I am unable to understand how would i start and where can i start.
Please suggest me i know the ESB,DSS,IS,BPS
For a typical CEP usecase, you configure the input event adaptor to connect to an event source, such as a JMS endpoint, Thrift endpoint(WSO2Event adaptor in CEP 3.0.0) etc. Event builder specifies how the incoming message will be mapped.
Next the execution plans will have the actual query (the processing part) of the execution flow. This is where the CEP engine actually processes the events.
Event formatter formats it to an output format as needed. The output event adaptor connects to the actual endpoint to which the processed result would be published. It would go and publish to a JMS endpoint, email, database etc.
To get started, you need to create an input event adaptor, then an event builder that uses the input event adaptor, then the execution plan, then the output event adaptor, and an event formatter that would format the result from the execution plan and send to the relevant output adaptor. You can find the flow in [1].
You can find example configurations in /samples/artifacts directory. You can find an overview of samples in [2] and can find how to run them [3]. Each sample has an associated producer and a consumer that simulates real world event producers/consumers. Samples would be the best place to learn more about CEP configurations.
[1] http://docs.wso2.org/display/CEP300/CEP+Configuration+Overview
[2] http://docs.wso2.org/display/CEP300/Overview+of+Samples
[3] http://docs.wso2.org/display/CEP300/Setting+up+CEP+Samples