Skip to content

Instantly share code, notes, and snippets.

Avatar

Maximilian Schremser maxschremser

View GitHub Profile
View build.gradle
dependencies {
compile project(':core')
}
apply plugin: 'application'
mainClassName = "com.schremser.spring.jms.client.JmsClient"
run {
standardInput = System.in
}
View JmsClient.java
package com.schremser.spring.jms.client;
import com.schremser.spring.jms.core.JndiConfiguration;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.Bean;
View default.properties
java.naming.provider.url=file:../jms/jms_test
java.naming.factory.initial=com.sun.jndi.fscontext.RefFSContextFactory
java.naming.security.principal=guest
java.naming.security.credentials=guest
jms.queue.export=exportQueue
jms.queue.import=importQueue
jms.connection.factory=ConnectionFactory
View JmsServer.java
package com.schremser.spring.jms.server;
import com.schremser.spring.jms.core.JndiConfiguration;
import com.schremser.spring.jms.server.receiver.QueueMessageReceiver;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
View build.gradle
dependencies {
compile project(':core')
}
apply plugin: 'application'
mainClassName = "com.schremser.spring.jms.server.JmsServer"
View build.gradle
allprojects {
group 'com.schremser'
version '1.0'
apply plugin: 'java'
sourceCompatibility = 1.8
repositories {
mavenCentral()
}
View JndiConfiguration.java
package com.schremser.spring.jms.core;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;
import org.springframework.jms.connection.TransactionAwareConnectionFactoryProxy;
import org.springframework.jndi.JndiObjectFactoryBean;
You can’t perform that action at this time.