Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge broadcaster and pipeline #38

Merged
merged 4 commits into from
Mar 27, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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