Skip to content

Commit

Permalink
Merge broadcaster and pipeline (#38)
Browse files Browse the repository at this point in the history
* Merging broadcaster and pipeline to use routing slip, with header controlling the exchange pattern.

* Removing pipeline now that we've merged

* Un derping the bad upstream pull

* Checkstyle fixees
  • Loading branch information
dannylamb authored and ruebot committed Mar 27, 2017
1 parent 558ef69 commit 82c487d
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 140 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

import static org.apache.camel.LoggingLevel.INFO;

import org.apache.camel.ExchangePattern;
import org.apache.camel.builder.RouteBuilder;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand All @@ -37,14 +38,23 @@ public class BroadcastRouter extends RouteBuilder {
*/
public void configure() throws Exception {

// Distribute message based on configured header.
// Distribute message based on headers.
from("{{input.stream}}")
.routeId("MessageBroadcaster")
.description("Broadcast messages from one queue/topic to other specified queues/topics.")
.description("Broadcast messages from one queue/topic to other queues/topics")
.log(INFO, LOGGER,
"Distributing message: ${headers[JMSMessageID]} with timestamp ${headers[JMSTimestamp]}")
.recipientList(simple("${headers[IslandoraBroadcastRecipients]}"))
.ignoreInvalidEndpoints();
.filter(header("IslandoraExchangePattern"))
.process(exchange -> {
final String patternName = exchange.getIn().getHeader("IslandoraExchangePattern", String.class);
try {
exchange.setPattern(ExchangePattern.asEnum(patternName));
} catch (IllegalArgumentException e) {
LOGGER.warn("Ignoring malformed exchange pattern: " + patternName);
}
})
.end()
.routingSlip(header("IslandoraBroadcastRecipients")).ignoreInvalidEndpoints();
}
}

17 changes: 0 additions & 17 deletions islandora-connector-pipeline/README.md

This file was deleted.

32 changes: 0 additions & 32 deletions islandora-connector-pipeline/build.gradle

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

11 changes: 0 additions & 11 deletions karaf/src/main/resources/features.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,4 @@

</feature>

<feature name="islandora-connector-pipeline" version="${project.version}" start-level="80">
<details>Distributes a message to a list of queues/topics sequentially.</details>

<feature version="${fcrepoCamelToolboxVersion}">fcrepo-service-activemq</feature>

<bundle>mvn:ca.islandora.alpaca/islandora-connector-pipeline/${project.version}</bundle>

<configfile finalname="/etc/ca.islandora.alpaca.connector.pipeline.cfg">mvn:ca.islandora.alpaca/islandora-connector-pipeline/${project.version}/cfg/configuration</configfile>

</feature>

</features>
2 changes: 0 additions & 2 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
include ':islandora-karaf'
include ':islandora-indexing-triplestore'
include ':islandora-connector-broadcast'
include ':islandora-connector-pipeline'

project(':islandora-karaf').projectDir = "$rootDir/karaf" as File
project(':islandora-indexing-triplestore').projectDir = "$rootDir/islandora-indexing-triplestore" as File
project(':islandora-connector-broadcast').projectDir = "$rootDir/islandora-connector-broadcast" as File
project(':islandora-connector-pipeline').projectDir = "$rootDir/islandora-connector-pipeline" as File

0 comments on commit 82c487d

Please # to comment.