How do I communicate apache MQ with wso2 BAM server? (no ESB keeping it simple) - queue

I am trying to get some simple web statistics using a wso2 BAM server, I have installed it, I understand how the events are defined, stored on the casssandra database etc. but I lack the most important thing: how to pass the events themselves to the BAM server?
I have programmed systems where json files are stored in a file ("queue") and my java process reads and processes them every 30 seconds, I thought this would be similar but the truth is I am pretty lost.
The port 7611 is TCP, listening.
Do I have to send the BAM server the events throught it?
Any help would be greatly apprecciated!

AFAIK, WSO2 BAM is not supported for apache mq directly. you have to use ESB or CEP to send events to BAM through thrift (Then you can use apache mq to send the events to ESB/CEP and through any of these product, you can send the events to BAM) .
But You can use the REST api to send the events to BAM which is more simple approach. Please refer the doc [1]. I thing future releases of BAM will support for jms (FYI, refer [2]).
[1] http://docs.wso2.org/wiki/display/BAM220/REST+API
[2] WSO2 BAM with JMS
Thnaks,
Mohan

BAM can get events either through REST API or through Thrift API.
7611 is the unsecured Thrift port and 7711 is the secured Thrift port by default.
As currently BAM does not have out-of-the-box Data Agent for Apache MQ, you have to write a one yourself.
If you want to publish events directly to BAM using Java you can use the DataBridge component in WSO2 code base. (i.e., use https://svn.wso2.org/repos/wso2/carbon/platform/branches/4.1.0/components/data-bridge/org.wso2.carbon.databridge.agent.thrift/4.1.1)

Related

KSQL websocket endpoints

I want to use continuous queries to KSQL Server using web socket queries.
I heard that the KSQL CLI and Control Center interact with KSQL Server using web socket requests, but I did not find any information on using web sockets in the KSQL REST API reference. How to configure and use this feature?
Websockets is not a supported API, and not documented.
I guess you could run Confluent Control Center yourself and sniff its behaviour, but there'd be no guarantee that the API wouldn't change.

Is middleware needed for a REST service to be consumed?

There is an external web-service (REST based) which provides logistics service. In order to consume it from our application (which is java stack), I created a client library (using jersey and jackson, which is a self-contained jar file, and gives simple getters and setters to work with). All that is needed to consume this REST service is this jar file (which is being used as re-usable asset).
However, one of our clients asked, "since we already have ESB (a middleware from IBM) for our existing integrations, why can we not have this integration also through ESB ?"
Is it possible to consume the REST based service using a middleware such as ESB(or MQ) ? If so, how ?
Will it be wise to do it ?
What arguments can I posit to my client to tell them this may not work ?
Thanks.
Is it possible to consume the REST based service using a middleware such as ESB(or MQ) ? If so, how ? -
Yes. Every ESB has its syntax/APIs. Should not be difficult to understand if you are already working with REST/http requests. Note, MQ is a message broker that will allow asynchronous communication. For example, the application that wants to consume the REST service can send a message to the broker and not wait for a response from the external service. The message broker in turn can talk REST to the external service. The message broker might expose a REST interface to consume messages. But it all depends on the use case. You may want to call REST service synchronously.
Most ESBs support calling external web services REST/SOAP. So an ESB does not necessarily mean MQ.
Will it be wise to do it ?
It depends. Many organizations set up ESB/Gateway as a policy and to route/filter/govern all external routings. Also to manage load, HA etc.
What arguments can I posit to my client to tell them this may not work ?
It will most certainly work. You should assess if using an ESB is an overhead based on your requirements.

How to extend Balana OpenAZ PEP to send requests to remote WSO2 Identity Server?

What's the appropriate way to extend a Balana-OpenAZ based PEP to send XACML3 decision requests to a remote WSO2 Identity Server PDP?
You want to send XACML decision request from PEP to Identity Server PDP. Still Identity Server only supports SOAP based web service API, Thrift based API and WS-XACML. Therefore i guess, best way to start is using SOAP based web service API. You can find sample java based client from here to write a extension for Balana-OpenAZ PEP.

How can i receive the REST API request in Mule?

I have used local JIRA Server and i am using Webhook integration concept in JIRA. Here i am giving the Webhook URL is "localhost:8081/webhook" and Event is Create and Update issue. when i am create or update issue means it will be pass to "localhost:8081/webhook". The same address only i gave in mule also but its not working in my MULE. Mule didn't listen the webservice. How can i USE REST API in mule. Which flow is used for receive the JSON format REST API data. It's possible means how can i do this work.
By far the easiest way to do this in Mule now is to use the new Api Kit and write your service description in RAML.
Intro material with docs and examples at: ww.mulesoft.org/documentation/display/current/APIkit
The mule http components may be outboud e.g call your rest api or inbound where the mule server will listen for an event on a http port and url
You say mule is not listening, you should be able to quite simply setup a mule inbound http component flow .. and trigger this flow by pointing your browser at it. I think you will find mule is listening correctly, and you may have mis-configured some of your settings?

Apache can't send request to localhost:8080 (to use Mule Esb Flow)

I'm trying to use a sample web application that use Ajax to send a request to a php REST service.
I need to use Mule ESB to do this, so i fix my ajax function to send request to ESB on localhost:8080. But the browser said that i can't do this for security reason.
So, there are any way to use mule ESB with a web app (local appache server) locally ?
Trying to GET a resource from the same host but from a different port is considered cross scripting as explained here
If you want to retrieve it you can:
all the option listed at the above link
put mule behind a reverse proxy within your apache configuration
serve all the content via mule