Skip to content

Commit

Permalink
[resolves #1471] Add support for component splunk
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Diesler committed Mar 7, 2017
1 parent 022fcb5 commit e540748
Show file tree
Hide file tree
Showing 13 changed files with 132 additions and 3 deletions.
2 changes: 1 addition & 1 deletion catalog/src/main/resources/component.roadmap
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ smpp
smpps
smtp
smtps
splunk
spring-event
sql
sql-stored
Expand Down Expand Up @@ -148,7 +149,6 @@ nagios
netty4-http
rabbitmq
snmp
splunk
spring-batch
spring-integration
spring-ldap
Expand Down
3 changes: 3 additions & 0 deletions docs/guide/components/camel-splunk.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
### camel-splunk

The http://camel.apache.org/splunk.html[splunk,window=_blank] component provides access to http://docs.splunk.com/Documentation/Splunk/latest[Splunk,window=_blank], via the Splunk provided client Rest API, allowing you to publish and search for events in Splunk.
2 changes: 2 additions & 0 deletions docs/guide/components/index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,8 @@ include::camel-spring.adoc[]

include::camel-sjms.adoc[]

include::camel-splunk.adoc[]

include::camel-sql.adoc[]

include::camel-ssh.adoc[]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@
<module name="org.apache.camel.component.smpp" export="true" services="export" optional="true" />
<module name="org.apache.camel.component.snakeyaml" export="true" services="export" optional="true" />
<module name="org.apache.camel.component.soap" export="true" services="export" optional="true" />
<module name="org.apache.camel.component.splunk" export="true" services="export" optional="true" />
<module name="org.apache.camel.component.spring.security" export="true" services="export" optional="true" >
<imports>
<include path="META-INF" />
Expand Down
13 changes: 13 additions & 0 deletions feature/etc/smartics/camel-modules.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1371,6 +1371,19 @@
</dependencies>
</module>

<module name="org.apache.camel.component.splunk">
<include artifact="org.apache.camel:camel-splunk" />
<include artifact="org.apache.servicemix.bundles:org.apache.servicemix.bundles.splunk" />
<apply-to-dependencies skip="true">
<include module="org.apache.camel.apt" />
<include module="org.springframework.boot" />
</apply-to-dependencies>
<dependencies>
<module name="javax.api"/>
<module name="org.slf4j"/>
</dependencies>
</module>

<module name="org.apache.camel.component.sql">
<include artifact="org.apache.camel:camel-sql" />
<apply-to-dependencies skip="true">
Expand Down
2 changes: 1 addition & 1 deletion feature/etc/smartics/skipped-modules.xml
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
</module>

<module name="org.apache.servicemix.bundles" skip="true">
<include artifact="org.apache.servicemix.bundles:(.*)" />
<include artifact="org.apache.servicemix.bundles:org.apache.servicemix.bundles.javax-cache-api" />
</module>

<module name="org.apache.tomcat.embed" skip="true">
Expand Down
4 changes: 4 additions & 0 deletions feature/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,10 @@
<groupId>org.apache.camel</groupId>
<artifactId>camel-servicenow</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-splunk</artifactId>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-soap</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@
<module name="org.apache.camel.component.smpp" export="true" services="export" optional="true" />
<module name="org.apache.camel.component.snakeyaml" export="true" services="export" optional="true" />
<module name="org.apache.camel.component.soap" export="true" services="export" optional="true" />
<module name="org.apache.camel.component.splunk" export="true" services="export" optional="true" />
<module name="org.apache.camel.component.spring.security" export="true" services="export" optional="true" >
<imports>
<include path="META-INF" />
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.1" name="org.apache.camel.component.splunk">
<resources>
<artifact name="${org.apache.camel:camel-splunk}" />
<artifact name="${org.apache.servicemix.bundles:org.apache.servicemix.bundles.splunk}" />
</resources>
<dependencies>
<module name="javax.api" />
<module name="org.slf4j" />
<module name="com.google.code.gson" />
<module name="javax.xml.bind.api" />
<module name="org.apache.camel.core" />
<module name="org.joda.time" />
</dependencies>
</module>
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
/*
* #%L
* Wildfly Camel :: Testsuite
* %%
* Copyright (C) 2013 - 2015 RedHat
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* #L%
*/

package org.wildfly.camel.test.splunk;

import org.apache.camel.CamelContext;
import org.apache.camel.ProducerTemplate;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.mock.MockEndpoint;
import org.apache.camel.component.splunk.event.SplunkEvent;
import org.apache.camel.impl.DefaultCamelContext;
import org.jboss.arquillian.container.test.api.Deployment;
import org.jboss.arquillian.junit.Arquillian;
import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.jboss.shrinkwrap.api.spec.JavaArchive;
import org.junit.Assume;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.wildfly.extension.camel.CamelAware;

@CamelAware
@RunWith(Arquillian.class)
public class SplunkIntegrationTest {

@Deployment
public static JavaArchive createdeployment() {
JavaArchive archive = ShrinkWrap.create(JavaArchive.class, "camel-splunk-tests");
return archive;
}

@Test
public void testSalesforceQuery() throws Exception {

String SPLUNK_USERNAME = System.getenv("SPLUNK_USERNAME");
String SPLUNK_PASSWORD = System.getenv("SPLUNK_PASSWORD");
Assume.assumeNotNull(SPLUNK_USERNAME, SPLUNK_PASSWORD);

SplunkEvent splunkEvent = new SplunkEvent();
splunkEvent.addPair("key1", "value1");
splunkEvent.addPair("key2", "value2");
splunkEvent.addPair("key3", "value1");

CamelContext camelctx = new DefaultCamelContext();
camelctx.addRoutes(new RouteBuilder() {
@Override
public void configure() throws Exception {
from("direct:submit")
.to("splunk://submit?username=" + SPLUNK_USERNAME + "&password=" + SPLUNK_PASSWORD + "&sourceType=testSource&source=test")
.to("mock:result");
}
});

MockEndpoint mock = camelctx.getEndpoint("mock:result", MockEndpoint.class);
mock.expectedMinimumMessageCount(1);

camelctx.start();
try {
ProducerTemplate producer = camelctx.createProducerTemplate();
producer.sendBody("direct:submit", splunkEvent);
mock.assertIsSatisfied();
} finally {
camelctx.stop();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
^com/github/kristofa/brave(.*)
^com/google/protobuf
^com/mongodb(.*)
^com/opengamma(.*)
^com/opengamma(.*)
^com/splunk(.*)
^com/sun/syndication(.*)
^groovy(.*)
^io/nats(.*)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,8 @@ com/mongodb/operation
com/mongodb/selector
com/mongodb/util
com/opengamma/elsql
com/splunk
com/splunk/modularinput
com/sun/syndication/feed
com/sun/syndication/feed/atom
com/sun/syndication/feed/module
Expand Down Expand Up @@ -714,6 +716,9 @@ org/apache/camel/component/sjms/taskmanager
org/apache/camel/component/sjms/tx
org/apache/camel/component/smpp
org/apache/camel/component/snakeyaml
org/apache/camel/component/splunk
org/apache/camel/component/splunk/event
org/apache/camel/component/splunk/support
org/apache/camel/component/spring
org/apache/camel/component/spring/security
org/apache/camel/component/spring/security/config
Expand Down
2 changes: 2 additions & 0 deletions patch/etc/baseline/module-list.txt
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,8 @@
/org/apache/camel/component/smpp/main/jsmpp-2.3.2.jar
/org/apache/camel/component/snakeyaml/main/camel-snakeyaml-2.18.2.jar
/org/apache/camel/component/soap/main/camel-soap-2.18.2.jar
/org/apache/camel/component/splunk/main/camel-splunk-2.18.2.jar
/org/apache/camel/component/splunk/main/org.apache.servicemix.bundles.splunk-1.5.0.0_1.jar
/org/apache/camel/component/spring/security/main/camel-spring-security-2.18.2.jar
/org/apache/camel/component/sql/main/camel-sql-2.18.2.jar
/org/apache/camel/component/ssh/main/camel-ssh-2.18.2.jar
Expand Down

0 comments on commit e540748

Please sign in to comment.