Skip to content

Commit 26a8b36

Browse files
Added consumer agent jar with dependencies to pom. (Minor bug fix.)
1 parent 24f53ac commit 26a8b36

File tree

2 files changed

+30
-3
lines changed

2 files changed

+30
-3
lines changed

logback-amqp-consumer/pom.xml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,31 @@
2828
<version>2.2.0</version>
2929
</dependency>
3030
</dependencies>
31+
<build>
32+
<plugins>
33+
<plugin>
34+
<groupId>org.apache.maven.plugins</groupId>
35+
<artifactId>maven-assembly-plugin</artifactId>
36+
<version>2.2</version>
37+
<configuration>
38+
<descriptorRefs>
39+
<descriptorRef>jar-with-dependencies</descriptorRef>
40+
</descriptorRefs>
41+
<archive>
42+
<manifest>
43+
<mainClass>ch.qos.logback.amqp.AmqpConsumerAgentMain</mainClass>
44+
</manifest>
45+
</archive>
46+
</configuration>
47+
<executions>
48+
<execution>
49+
<phase>package</phase>
50+
<goals>
51+
<goal>single</goal>
52+
</goals>
53+
</execution>
54+
</executions>
55+
</plugin>
56+
</plugins>
57+
</build>
3158
</project>

logback-amqp-consumer/src/main/java/ch/qos/logback/amqp/AmqpConsumerAgentMain.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,10 @@ public static final void main (final String[] arguments)
5454
agent.start ();
5555

5656
while (true) {
57+
boolean stillRunning = false;
5758
for (final AmqpConsumerAgent agent : agents)
58-
if (!agent.isRunning ())
59-
agents.remove (agent);
60-
if (agents.isEmpty ())
59+
stillRunning |= agent.isRunning ();
60+
if (!stillRunning)
6161
break;
6262
try {
6363
Thread.sleep (AmqpConsumerAgent.waitTimeout);

0 commit comments

Comments
 (0)