Arch2Arch Tab BEA.com
Syndicate this blog (XML)

HTTP Adapter for WLEvS

Bookmark Blog Post

del.icio.us del.icio.us
Digg Digg
DZone DZone
Furl Furl
Reddit Reddit

Paco Gomez's Blog | September 11, 2007   9:37 AM | Comments (0)


WebLogic Event Server provides an open and documented API to build adapters. Through an adapter, external applications can send events to WLEvS.

The HTTP Adapter for WebLogic Event Server allows sending events to WLEvS using HTTP Get or Post requests. Using this adapter, users can send events to WLEvS via a web browser, command line tools like wget, Service Bus (ALSB) or any programming language with an HTTP API, like Java, .NET, C, JavaScript, Perl, Phyton, Ruby, etc.

Along with the adapter, I have provided a modified version of the HelloWorld application to illustrate the use of the HTTP Adapter.

The HTTP adapter registers a servlet on the servlet engine included in WLEvS. It accepts HTTP get and post requests, extracts the parameter values and sends an event to the listener attached to it.

Here is a sample HTTP/Get request that sends an event. The URL is: http://localhost:9002/adapter?message=hello&number=123

Using a browser to send an event:

wlevs_http_04.gif

Here is another example using wget:

wlevs_http_05.gif

Here are the events processed by the HelloWorldHttp application:

wlevs_http_03.gif

Similar to the csvadapter, the HttpAdapter is configurable and generates any type of Event described in the EPN configuration file, for example:

The adapter factory registered in the HttpAdapter bundle:
<osgi:service interface="com.bea.wlevs.ede.api.AdapterFactory">
  <osgi:service-properties>
    <prop key="type">HttpAdapterProvider</prop>
  </osgi:service-properties>
  <bean class="com.bea.wlevs.adapter.http.HttpAdapterFactoryImpl" >
    <property name="httpService" ref="jetty"/>
  </bean>
</osgi:service>
The EPN configuration in the HelloWorldHttp application:
<wlevs:event-type-repository>
  <wlevs:event-type type-name="HelloWorldEvent">
    <wlevs:class>com.bea.wlevs.event.example.helloworld.HelloWorldEvent</wlevs:class>
  </wlevs:event-type>
</wlevs:event-type-repository>

<wlevs:adapter id="httpAdapter" provider="HttpAdapterProvider" manageable="true">
  <wlevs:instance-property name="servletName" value="/adapter"/>
  <wlevs:instance-property name="eventTypeName" value="HelloWorldEvent"/>
  <wlevs:instance-property name="eventPropertyNames" value="message,number"/>
</wlevs:adapter>
Some use cases and benefits include:
  • This adapter can be used during development and testing to generate any type of events without having to create a custom adapter. It is a bit more interactive than the csvadapter as users can type the event data in the browser and send it immediately
  • In addition to the browser, users can use the wget utility on the command line and create shell scripts
  • the http adapter can be used for performance testing with standard web testing tools like LoadRunner or Grinder
  • jetty, the servlet engine in WLEvS can be configured and tuned for multithread and performance
  • easy to integrate with programs via HTTP GET/POST API (Java, .NET, JavaScript, C, Perl, Phyton, Ruby, etc)
  • we can use ALSB in front of WLEvS and have, with little configuration, any protocol supported by ALSB (MQ, ftp, file, etc) be able to talk to WLEvS. We just create an ALSB business service that uses HTTP GET to talk to WLEvS

Some useful links:
HTTP Adapter for WLEvS
WebLogic Event Server Product Center
AquaLogic Service Bus Product Center

Comments

Comments are listed in date ascending order (oldest first) | Post Comment



Only logged in users may post comments. Login Here.

Powered by
Movable Type 3.31