How to Deploy an Oracle CEP Application Using the Deployer Utility

25-4 Oracle Complex Event Processing Developers Guide Horatio,80,Argentina A load generator data feed file follows a simple format: ■ Each item of a particular data feed is on its own line. ■ Separate the fields of a data feed item with commas. ■ Do not include commas as part of a string field. ■ Do not include extraneous spaces before or after the commas, unless the space is literally part of the field value. ■ Include only string and numerical data in a data feed file such as integer, long, double, and float. ■ By default, the maximum length of a string field is 256 characters. To specify a longer string, set the length attribute of the char property in your event-type as Example 25–1 shows for the birthplace property. For more information, see Event Types for use With the csvgen Adapter on page 2-5.

25.5 Configuring the csvgen Adapter in Your Application

When using the load generator utility, you must use the csvgen adapter in your application because this Oracle CEP-provided adapter is specifically coded to read the data packets generated by the load generator. You register the csvgen adapter using the wlevs:adapter element in the EPN assembly file of your application, as with all adapters. Set the provide attribute to csvgen to specify that the provider is the csvgen adapter, rather than your own adapter. Additionally, you must specify the following child tags: ■ wlevs:instance-property element with name attribute port and value attribute configured_port, where configured_port corresponds to the value of the test.port property in the load generator property file. See Section 25.3, Creating a Load Generator Property File. ■ wlevs:instance-property element with name attribute eventTypeName and value attribute event_type_name, where event_type_name corresponds to the name of the event type that represents an item from the load-generated feed. ■ wlevs:instance-property element with name attribute eventPropertyNames and value attribute ordered_list_of_properties, where ordered_list_of_properties lists the names of the properties in the order that the load generator sends them, and consequently the csvgen adapter receives them. Before showing an example of how to configure the adapter, first assume that your application registers an event type called PersonType in the EPN assembly file using the wlevs:metada element shown below: wlevs:event-type-repository wlevs:event-type type-name=PersonType wlevs:properties Note: The load generator does not fully comply with the CSV specification http:www.creativyst.comDocArticlesCSVCSV01.ht m . Testing Applications With the Load Generator and csvgen Adapter 25-5 wlevs:property name=name type=char wlevs:property name=age type=int wlevs:property name=birthplace type=char wlevs:properties wlevs:event-type wlevs:event-type-repository This event type corresponds to the data feed file shown in Section 25.4, Creating a Data Feed File. To configure the csvgen adapter that receives this data, use the following wlevs:adapter element: wlevs:adapter id=csvgenAdapter provider=csvgen wlevs:instance-property name=port value=9001 wlevs:instance-property name=eventTypeName value=PersonType wlevs:instance-property name=eventPropertyNames value=name,age,birthplace wlevs:adapter Note how the bolded values in the adapter configuration example correspond to the PersonType event type registration. If you use the wlevs:class element to specify your own JavaBean when registering the event type, then the eventPropertyNames value corresponds to the JavaBean properties. For example, if your JavaBean has a getName method, then one of the properties of your JavaBean is name. For more information on event types, see Chapter 2.1.4, Creating Oracle CEP Event Types . 25-6 Oracle Complex Event Processing Developers Guide 26 Testing Applications With the Event Inspector 26-1 26 Testing Applications With the Event Inspector This chapter describes how to use the Event Inspector service to trace and inject events with any stage in the Event Processing Network EPN, including: ■ Section 26.1, Overview of Testing Applications With the Event Inspector ■ Section 26.2, Configuring the Event Inspector HTTP Pub-Sub Server ■ Section 26.3, Injecting Events ■ Section 26.4, Tracing Events

26.1 Overview of Testing Applications With the Event Inspector

Using the Event Inspector service, you can: ■ View the events flowing out of any stage in the EPN ■ Inject events into any stage in the EPN You can use the Event Inspector service to test and debug Oracle CQL queries during development. This section describes: ■ Section 26.1.1, Tracing Events ■ Section 26.1.2, Injecting Events ■ Section 26.1.3, Event Inspector Event Types ■ Section 26.1.4, Event Inspector HTTP Publish-Subscribe Channel and Server ■ Section 26.1.5, Event Inspector Clients For more information on testing and debugging, see Section 5.4, Debugging an Oracle CEP Application Running on an Oracle CEP Server .

26.1.1 Tracing Events

Using the Event Inspector service, you can view the events leaving any stage of the EPN. Note: The Event Inspector service is not for use on a production Oracle CEP server. It is for use only during development. 26-2 Oracle Complex Event Processing Developers Guide The Event Inspector service uses a common HTTP pub-sub channel and server to trace events. A trace event must have its binding attribute set to outbound. For more information, see: ■ Section 26.1.3, Event Inspector Event Types ■ Section 26.1.4, Event Inspector HTTP Publish-Subscribe Channel and Server ■ Section 26.4, Tracing Events

26.1.2 Injecting Events

Using the Event Inspector service, you can inject events into any stage of the EPN. The Event Inspector service uses a HTTP pub-sub channel and server to inject events. An injected event must have its binding attribute set to inbound. Using an Event Inspector client, you can inject: ■ A single, simple event by type, such as the StockTick event. In this case, the specific event property types that you can use depends on the client. ■ A single event directly to the HTTP pub-sub channel as a JSON-formatted character string. In this case, you can use any event property that JSON can represent. ■ Multiple events using a file that contains one or more JSON-formatted character strings. In this case, you can use any event property that JSON can represent. The Event Inspector service client will parse the file and inject all its JSON strings to the HTTP pub-sub channel. You can use the GSON Java library to help you convert Java objects to JSON format when creating your input file. For more information, see: ■ http:www.json.org ■ http:code.google.compgoogle-gson ■ Section 26.1.3, Event Inspector Event Types ■ Section 26.1.4, Event Inspector HTTP Publish-Subscribe Channel and Server ■ Section 26.3, Injecting Events

26.1.3 Event Inspector Event Types

All Oracle CEP event types are supported: JavaBean, Java Class, MapEvent, and tuple. The Event Inspector service converts events to the JavaScript Object Notation JSON format before publishing to the trace channel and you must inject events in JSON format. JSON-formatted events must conform to the structure that Example 26–1 shows. Table 26–1 lists the required attributes.