Do raindrops follow a certain hierarchy when they fall?
- by Anthony T. Hincks
Use the following repository:
<repository>
<id>clojars</id>
<name>Clojars repository</name>
<url>https://clojars.org/repo</url>
</repository>
Use the following maven dependency:
<dependency>
<groupId>io.github.qtrouper</groupId>
<artifactId>qtrouper</artifactId>
<version>0.0.1-1</version>
</dependency>
Clone the source:
git clone github.com/koushikr/qtrouper
Build
mvn install
QTrouper provides the following capabilities
The overriding design goal for qtrouper model is to make it as ready as possible to onboard a new message processor. The idea is that a formatted consumer definition is usable as-is, as a processing unit inside the app, without having to create any additiional boiler plate code to support the same. And a dropwizard bundle is made out of it for easy integration with dropwizard apps.
QTrouper uses rabbitMQ as its backend interface and the
static class SampleConfiguration extends Configuration{
private RabbitConfiguration rabbitConfiguration;
}
}
TrouperBundle<SampleConfiguration> trouperBundle = new TrouperBundle<SampleConfiguration>() {
@Override
public RabbitConfiguration getRabbitConfiguration(SampleConfiguration configuration) {
return null;
}
};
bootstrap.addBundle(trouperBundle);
static class QueueingActor extends QTrouper<QueueContext> {
@Inject
public SymphonyActor(QueueConfiguration consumerConfiguration, RabbitConnection rabbitConnection) {
super("sampleQueue",
consumerConfiguration,
rabbitConnection,
QueueContext.class,
Collections.emptySet());
}
@Override
protected boolean process(QueueContext queueContext, QAccessInfo accessInfo){
try{
return processor.consume(queueContext, accessInfo);
}catch (Exception e){
log.error("Error processing a main queue message for reference Id {}", queueContext.getServiceReference());
return false;
}
}
@Override
protected boolean processSideline(QueueContext queueContext, QAccessInfo accessInfo) {
try{
return processor.consumeSideline(queueContext, accessInfo);
}catch (Exception e){
log.error("Error processing a sideline queue message for reference Id {}", queueContext.getServiceReference());
return false;
}
}
}
Copyright 2019 Koushik R rkoushik.14@gmail.com.
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.
Can you improve this documentation?Edit on GitHub
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close