Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
武汉红喜
whatsmars
提交
a67b38bb
W
whatsmars
项目概览
武汉红喜
/
whatsmars
通知
3
Star
0
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
W
whatsmars
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
a67b38bb
编写于
12月 23, 2017
作者:
武汉红喜
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
spring-boot-samples-activemq
上级
765be592
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
185 addition
and
0 deletion
+185
-0
pom.xml
pom.xml
+1
-0
whatsmars-spring-boot-samples/pom.xml
whatsmars-spring-boot-samples/pom.xml
+47
-0
whatsmars-spring-boot-samples/whatsmars-boot-samples-activemq/pom.xml
...ring-boot-samples/whatsmars-boot-samples-activemq/pom.xml
+43
-0
whatsmars-spring-boot-samples/whatsmars-boot-samples-activemq/src/main/java/com/whatsmars/boot/samples/activemq/Consumer.java
...in/java/com/whatsmars/boot/samples/activemq/Consumer.java
+14
-0
whatsmars-spring-boot-samples/whatsmars-boot-samples-activemq/src/main/java/com/whatsmars/boot/samples/activemq/Producer.java
...in/java/com/whatsmars/boot/samples/activemq/Producer.java
+29
-0
whatsmars-spring-boot-samples/whatsmars-boot-samples-activemq/src/main/java/com/whatsmars/boot/samples/activemq/SampleActiveMQApplication.java
...mars/boot/samples/activemq/SampleActiveMQApplication.java
+25
-0
whatsmars-spring-boot-samples/whatsmars-boot-samples-activemq/src/main/resources/application.yml
...-boot-samples-activemq/src/main/resources/application.yml
+6
-0
whatsmars-spring-boot-samples/whatsmars-boot-samples-activemq/src/main/resources/logback.xml
...mars-boot-samples-activemq/src/main/resources/logback.xml
+20
-0
未找到文件。
pom.xml
浏览文件 @
a67b38bb
...
...
@@ -25,6 +25,7 @@
<module>
whatsmars-spring-cloud
</module>
<module>
whatsmars-sharding-jdbc
</module>
<module>
whatsmars-earth
</module>
<module>
whatsmars-spring-boot-samples
</module>
</modules>
<properties>
...
...
whatsmars-spring-boot-samples/pom.xml
0 → 100644
浏览文件 @
a67b38bb
<?xml version="1.0" encoding="UTF-8"?>
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<parent>
<groupId>
com.whatsmars
</groupId>
<artifactId>
whatsmars-parent
</artifactId>
<version>
1.0-SNAPSHOT
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<artifactId>
whatsmars-spring-boot-samples
</artifactId>
<packaging>
pom
</packaging>
<name>
${project.artifactId}
</name>
<description>
Spring Boot Samples
</description>
<properties>
<main.basedir>
${basedir}/..
</main.basedir>
<java.version>
1.8
</java.version>
</properties>
<modules>
<module>
whatsmars-boot-samples-activemq
</module>
</modules>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-dependencies
</artifactId>
<version>
${spring-boot.version}
</version>
<type>
pom
</type>
<scope>
import
</scope>
</dependency>
<dependency>
<groupId>
org.slf4j
</groupId>
<artifactId>
jcl-over-slf4j
</artifactId>
</dependency>
<dependency>
<groupId>
ch.qos.logback
</groupId>
<artifactId>
logback-classic
</artifactId>
</dependency>
</dependencies>
</dependencyManagement>
</project>
\ No newline at end of file
whatsmars-spring-boot-samples/whatsmars-boot-samples-activemq/pom.xml
0 → 100644
浏览文件 @
a67b38bb
<?xml version="1.0" encoding="UTF-8"?>
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<parent>
<groupId>
com.whatsmars
</groupId>
<artifactId>
whatsmars-spring-boot-samples
</artifactId>
<version>
1.0-SNAPSHOT
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<artifactId>
whatsmars-boot-samples-activemq
</artifactId>
<name>
${project.artifactId}
</name>
<description>
Spring Boot ActiveMQ Sample
</description>
<properties>
<main.basedir>
${basedir}/../..
</main.basedir>
</properties>
<dependencies>
<!-- Compile -->
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-activemq
</artifactId>
</dependency>
<!-- Test -->
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-test
</artifactId>
<scope>
test
</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-maven-plugin
</artifactId>
</plugin>
</plugins>
</build>
</project>
\ No newline at end of file
whatsmars-spring-boot-samples/whatsmars-boot-samples-activemq/src/main/java/com/whatsmars/boot/samples/activemq/Consumer.java
0 → 100644
浏览文件 @
a67b38bb
package
com.whatsmars.boot.samples.activemq
;
import
org.springframework.jms.annotation.JmsListener
;
import
org.springframework.stereotype.Component
;
@Component
public
class
Consumer
{
@JmsListener
(
destination
=
"sample.queue"
)
public
void
receiveQueue
(
String
text
)
{
System
.
out
.
println
(
text
);
}
}
\ No newline at end of file
whatsmars-spring-boot-samples/whatsmars-boot-samples-activemq/src/main/java/com/whatsmars/boot/samples/activemq/Producer.java
0 → 100644
浏览文件 @
a67b38bb
package
com.whatsmars.boot.samples.activemq
;
import
javax.jms.Queue
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.CommandLineRunner
;
import
org.springframework.jms.core.JmsMessagingTemplate
;
import
org.springframework.stereotype.Component
;
@Component
public
class
Producer
implements
CommandLineRunner
{
@Autowired
private
JmsMessagingTemplate
jmsMessagingTemplate
;
@Autowired
private
Queue
queue
;
@Override
public
void
run
(
String
...
args
)
throws
Exception
{
send
(
"Sample message"
);
System
.
out
.
println
(
"Message was sent to the Queue"
);
}
public
void
send
(
String
msg
)
{
this
.
jmsMessagingTemplate
.
convertAndSend
(
this
.
queue
,
msg
);
}
}
\ No newline at end of file
whatsmars-spring-boot-samples/whatsmars-boot-samples-activemq/src/main/java/com/whatsmars/boot/samples/activemq/SampleActiveMQApplication.java
0 → 100644
浏览文件 @
a67b38bb
package
com.whatsmars.boot.samples.activemq
;
import
javax.jms.Queue
;
import
org.apache.activemq.command.ActiveMQQueue
;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.jms.annotation.EnableJms
;
@SpringBootApplication
@EnableJms
public
class
SampleActiveMQApplication
{
@Bean
public
Queue
queue
()
{
return
new
ActiveMQQueue
(
"sample.queue"
);
}
public
static
void
main
(
String
[]
args
)
{
SpringApplication
.
run
(
SampleActiveMQApplication
.
class
,
args
);
}
}
\ No newline at end of file
whatsmars-spring-boot-samples/whatsmars-boot-samples-activemq/src/main/resources/application.yml
0 → 100644
浏览文件 @
a67b38bb
---
spring
:
activemq
:
in-memory
:
true
pool
:
enabled
:
false
\ No newline at end of file
whatsmars-spring-boot-samples/whatsmars-boot-samples-activemq/src/main/resources/logback.xml
0 → 100644
浏览文件 @
a67b38bb
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<property
name=
"log.context.name"
value=
"sharding-jdbc-spring-namespace-mybatis-example"
/>
<property
name=
"log.charset"
value=
"UTF-8"
/>
<property
name=
"log.pattern"
value=
"[%-5level] %date --%thread-- [%logger] %msg %n"
/>
<contextName>
${log.context.name}
</contextName>
<appender
name=
"STDOUT"
class=
"ch.qos.logback.core.ConsoleAppender"
>
<encoder
charset=
"${log.charset}"
>
<pattern>
${log.pattern}
</pattern>
</encoder>
</appender>
<root>
<level
value=
"INFO"
/>
<appender-ref
ref=
"STDOUT"
/>
</root>
</configuration>
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录