INTEXT-22 - Polishing

This commit is contained in:
Gunnar Hillert
2012-10-01 16:11:16 -04:00
parent ec6aa137ac
commit 85bfd8c39e
12 changed files with 66 additions and 44 deletions

View File

@@ -1,42 +1,65 @@
Development
===================================
### to genereate eclipse project:
The example application depends on spring-integration-splunk. You have to
build that project first.
Spring Integration Splunk Sample
================================
1. change to "spring-integration-extensions/spring-integration-splunk" dir
2. ./gradlew publish
This sample demonstrates the usage of the *[Spring Integration Splunk][]* adapters.
Then you can generate eclipse project for the examples
3. change to "samples/splunk" dir
4. ./gradlew eclipse
## Requirements
Run example applications
=====================================
1. update Splunk server info in the "src/main/resources/org/springframework/integration/samples/splunk/SplunkCommon-context.xml"
2. run the main classes.
You may run outbound channel adapter applications to push some data into Splunk.
After that, you can run inbound channel adapter applications to read the data.
### Splunk Server
### Outbound channel adapter
You need to install or have access to a [Splunk][] Server. You can download [Splunk][] from:
Submit: SplunkOutboundChannelAdapterSubmitSample
Tcp: SplunkOutboundChannelAdapterTcpSample
Stream: SplunkOutboundChannelAdapterStreamSample
### Inbound channel adapter
* http://www.splunk.com/download
Blocking search: SplunkInboundChannelAdapterBlockingSample
Non blocking search: SplunkInboundChannelAdapterNonBlockingSample
Realtime search: SplunkInboundChannelAdapterRealtimeSample
Export search: SplunkInboundChannelAdapterExportSample
Saved search: SplunkInboundChannelAdapterSavedSample
#### Data Inputs
Depending on your Splunk Server installation, you may have to open up a TCP by adding an additional *data input*. E.g. the sample uses TCP port **9999**.
For instructions please see:
* http://docs.splunk.com/Documentation/Splunk/latest/Data/Monitornetworkports
### Spring Integration Splunk dependencies
The sample application depends on the [Spring Integration Splunk][] support. As of Oct 1, 2012, the dependencies for *Spring Integration Splunk* are available through the [SpringSource Maven Repository][]:
* https://repo.springsource.org/simple/libs-snapshot-local/org/springframework/integration/spring-integration-splunk/0.5.0.BUILD-SNAPSHOT
However, if you prefer, you can manually build the *Spring Integration Splunk* project. In order order to do so, follow the following steps:
1. Change to folder `spring-integration-extensions/spring-integration-splunk`
2. Execute `./gradlew publish`
This should install the [Spring Integration Splunk] jar files to your local Maven repository. Please see the [Spring Integration Splunk][] project for further information.
## Generate the Eclipse project:
Now you can generate the Eclipse project for the provided sample:
1. Change to folder `samples/splunk`
2. Execute `./gradlew eclipse`
## Run the example applications
1. Update the [Splunk][] server info in `src/main/resources/org/springframework/integration/samples/splunk/SplunkCommon-context.xml`
2. Run the main classes.
You may want to run the *Outbound Channel Adapter* application first in order to push some data into [Splunk][]. After that, run the *Inbound Channel Adapter* application to read the data.
### Outbound Channel Adapter
* **Submit**: SplunkOutboundChannelAdapterSubmitSample
* **Tcp**: SplunkOutboundChannelAdapterTcpSample
* **Stream**: SplunkOutboundChannelAdapterStreamSample
### Inbound Channel Adapter
* **Blocking search**: SplunkInboundChannelAdapterBlockingSample
* **Non blocking search**: SplunkInboundChannelAdapterNonBlockingSample
* **Realtime search**: SplunkInboundChannelAdapterRealtimeSample
* **Export search**: SplunkInboundChannelAdapterExportSample
* **Saved search**: SplunkInboundChannelAdapterSavedSample
[Splunk]: http://www.splunk.com/
[Spring Integration Splunk]: https://github.com/SpringSource/spring-integration-extensions/tree/master/spring-integration-splunk
[SpringSource Maven Repository]: https://repo.springsource.org/

View File

@@ -1,4 +1,4 @@
description = 'Spring Integration Splunk Adapter Example'
description = 'Spring Integration Splunk Sample'
apply plugin: 'base'
apply plugin: 'java'
apply plugin: 'eclipse'
@@ -23,9 +23,8 @@ task wrapper(type: Wrapper) {
eclipse {
project {
name = "spring-integration-splunk-examples"
name = "spring-integration-splunk-sample"
}
}
defaultTasks 'clean', 'build'

View File

@@ -26,7 +26,7 @@ public class SplunkInboundChannelAdapterBlockingSample {
public static void main(String args[]) {
ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext(
"SplunkInboundChannelAdapterTests-context.xml", SplunkInboundChannelAdapterBlockingSample.class);
"SplunkInboundChannelAdapterBlockingSample-context.xml", SplunkInboundChannelAdapterBlockingSample.class);
ctx.start();
}
}

View File

@@ -27,7 +27,7 @@ public class SplunkInboundChannelAdapterExportSample {
public static void main(String args[]) {
ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext(
"SplunkInboundChannelAdapterExportTests-context.xml", SplunkInboundChannelAdapterExportSample.class);
"SplunkInboundChannelAdapterExportSample-context.xml", SplunkInboundChannelAdapterExportSample.class);
ctx.start();
}
}

View File

@@ -26,7 +26,7 @@ public class SplunkInboundChannelAdapterNonBlockingSample {
public static void main(String args[]) {
ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext(
"SplunkInboundChannelAdapterNonBlockingTests-context.xml",
"SplunkInboundChannelAdapterNonBlockingSample-context.xml",
SplunkInboundChannelAdapterNonBlockingSample.class);
ctx.start();
}

View File

@@ -26,7 +26,7 @@ public class SplunkInboundChannelAdapterRealtimeSample {
public static void main(String args[]) {
ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext(
"SplunkInboundChannelAdapterRealtimeTests-context.xml", SplunkInboundChannelAdapterRealtimeSample.class);
"SplunkInboundChannelAdapterRealtimeSample-context.xml", SplunkInboundChannelAdapterRealtimeSample.class);
ctx.start();
}
}

View File

@@ -26,7 +26,7 @@ public class SplunkInboundChannelAdapterSavedSample {
public static void main(String args[]) {
ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext(
"SplunkInboundChannelAdapterSavedTests-context.xml", SplunkInboundChannelAdapterSavedSample.class);
"SplunkInboundChannelAdapterSavedSample-context.xml", SplunkInboundChannelAdapterSavedSample.class);
ctx.start();
}
}

View File

@@ -31,7 +31,7 @@ public class SplunkOutboundChannelAdapterStreamSample {
public static void main(String args[]) {
ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext(
"SplunkOutboundChannelAdapterStreamTests-context.xml", SplunkOutboundChannelAdapterStreamSample.class);
"SplunkOutboundChannelAdapterStreamSample-context.xml", SplunkOutboundChannelAdapterStreamSample.class);
ctx.start();
SubscribableChannel channel = ctx.getBean("outputToSplunk", SubscribableChannel.class);

View File

@@ -32,7 +32,7 @@ public class SplunkOutboundChannelAdapterSubmitSample {
public static void main(String args[]) {
ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext(
"SplunkOutboundChannelAdapterTests-context.xml", SplunkOutboundChannelAdapterSubmitSample.class);
"SplunkOutboundChannelAdapterSubmitSample-context.xml", SplunkOutboundChannelAdapterSubmitSample.class);
ctx.start();
generateMessage(ctx);

View File

@@ -31,7 +31,7 @@ public class SplunkOutboundChannelAdapterTcpSample {
public static void main(String args[]) {
ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext(
"SplunkOutboundChannelAdapterTcpTests-context.xml", SplunkOutboundChannelAdapterTcpSample.class);
"SplunkOutboundChannelAdapterTcpSample-context.xml", SplunkOutboundChannelAdapterTcpSample.class);
ctx.start();
SubscribableChannel channel = ctx.getBean("outputToSplunk", SubscribableChannel.class);

View File

@@ -10,7 +10,7 @@
http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd">
<context:component-scan base-package="org.springframework.integration"></context:component-scan>
<bean id="conversionService" class="org.springframework.context.support.ConversionServiceFactoryBean"/>

View File

@@ -14,7 +14,7 @@
<int-splunk:outbound-channel-adapter
id="splunkOutboundChannelAdapter" auto-startup="true" order="1"
channel="outputToSplunk" splunk-server-ref="splunkServer"
ingest="stream" host="stream.host">
ingest="stream" host="localhost">
</int-splunk:outbound-channel-adapter>
</beans>