-
Notifications
You must be signed in to change notification settings - Fork 155
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #154 from bancolombia/feature/jms-mq
Feature/jms mq
- Loading branch information
Showing
39 changed files
with
1,260 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
src/main/java/co/com/bancolombia/factory/adapters/DrivenAdapterMQ.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package co.com.bancolombia.factory.adapters; | ||
|
||
import co.com.bancolombia.exceptions.CleanException; | ||
import co.com.bancolombia.factory.ModuleBuilder; | ||
import co.com.bancolombia.factory.ModuleFactory; | ||
import co.com.bancolombia.factory.commons.MQCommonFactory; | ||
import co.com.bancolombia.factory.validations.ReactiveTypeValidation; | ||
import java.io.IOException; | ||
import lombok.AllArgsConstructor; | ||
|
||
@AllArgsConstructor | ||
public class DrivenAdapterMQ implements ModuleFactory { | ||
|
||
@Override | ||
public void buildModule(ModuleBuilder builder) throws IOException, CleanException { | ||
builder.runValidations(ReactiveTypeValidation.class); | ||
builder.setupFromTemplate("driven-adapter/mq-sender"); | ||
builder.appendToSettings("mq-sender", "infrastructure/driven-adapters"); | ||
builder.appendDependencyToModule("app-service", "implementation project(':mq-sender')"); | ||
new MQCommonFactory().buildModule(builder); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
src/main/java/co/com/bancolombia/factory/commons/MQCommonFactory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package co.com.bancolombia.factory.commons; | ||
|
||
import co.com.bancolombia.exceptions.CleanException; | ||
import co.com.bancolombia.factory.ModuleBuilder; | ||
import co.com.bancolombia.factory.ModuleFactory; | ||
import java.io.IOException; | ||
|
||
public class MQCommonFactory implements ModuleFactory { | ||
|
||
@Override | ||
public void buildModule(ModuleBuilder builder) throws IOException, CleanException { | ||
builder.setupFromTemplate("commons/mq-common"); | ||
builder | ||
.appendToProperties("ibm") | ||
.put("output-concurrency", 10) | ||
.put("output-queue", "DEV.QUEUE.1") | ||
.put("input-concurrency", 10) | ||
.put("input-queue", "DEV.QUEUE.2"); | ||
builder.appendToProperties("ibm.mq").put("channel", "DEV.APP.SVRCONN").put("user", "app"); | ||
builder.appendToSettings("mq-common", "infrastructure/helpers"); | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
src/main/java/co/com/bancolombia/factory/entrypoints/EntryPointMQ.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package co.com.bancolombia.factory.entrypoints; | ||
|
||
import co.com.bancolombia.exceptions.CleanException; | ||
import co.com.bancolombia.factory.ModuleBuilder; | ||
import co.com.bancolombia.factory.ModuleFactory; | ||
import co.com.bancolombia.factory.commons.MQCommonFactory; | ||
import co.com.bancolombia.factory.validations.ReactiveTypeValidation; | ||
import java.io.IOException; | ||
|
||
public class EntryPointMQ implements ModuleFactory { | ||
|
||
@Override | ||
public void buildModule(ModuleBuilder builder) throws IOException, CleanException { | ||
builder.runValidations(ReactiveTypeValidation.class); | ||
builder.setupFromTemplate("entry-point/mq-listener"); | ||
builder.appendToSettings("mq-listener", "infrastructure/entry-points"); | ||
builder.appendDependencyToModule("app-service", "implementation project(':mq-listener')"); | ||
new MQCommonFactory().buildModule(builder); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
src/main/resources/commons/mq-common/api/mq-destination-provider.java.mustache
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package {{package}}.mq.common.api; | ||
|
||
import javax.jms.Destination; | ||
import javax.jms.JMSContext; | ||
|
||
public interface MQDestinationProvider { | ||
Destination create(JMSContext context); | ||
} |
9 changes: 9 additions & 0 deletions
9
src/main/resources/commons/mq-common/api/mq-message-creator.java.mustache
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package {{package}}.mq.common.api; | ||
|
||
import javax.jms.JMSContext; | ||
import javax.jms.JMSException; | ||
import javax.jms.Message; | ||
|
||
public interface MQMessageCreator { | ||
Message create(JMSContext context) throws JMSException; | ||
} |
11 changes: 11 additions & 0 deletions
11
src/main/resources/commons/mq-common/api/mq-message-sender.java.mustache
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package {{package}}.mq.common.api; | ||
|
||
import reactor.core.publisher.Mono; | ||
|
||
import javax.jms.Destination; | ||
|
||
public interface MQMessageSender { | ||
Mono<String> send(Destination destination, MQMessageCreator messageCreator); | ||
Mono<String> send(MQMessageCreator messageCreator); | ||
} |
9 changes: 9 additions & 0 deletions
9
src/main/resources/commons/mq-common/api/mq-temporary-queues-container.java.mustache
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package {{package}}.mq.common.api; | ||
|
||
import javax.jms.TemporaryQueue; | ||
|
||
public interface MQTemporaryQueuesContainer { | ||
void registerTemporaryQueue(String alias, TemporaryQueue queue); | ||
TemporaryQueue get(String alias); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
dependencies { | ||
compile 'org.springframework:spring-context' | ||
compile 'com.ibm.mq:mq-jms-spring-boot-starter:{{mqVersion}}' | ||
} |
7 changes: 7 additions & 0 deletions
7
...ain/resources/commons/mq-common/config/exceptions/mq-invalid-listener-setup.java.mustache
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package {{package}}.mq.common.config.exceptions; | ||
|
||
public class MQInvalidListenerSetup extends RuntimeException { | ||
public MQInvalidListenerSetup(String message) { | ||
super(message); | ||
} | ||
} |
Oops, something went wrong.