Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
spring-boot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DEMO
spring-boot
Commits
aa0f90ec
Commit
aa0f90ec
authored
Aug 28, 2014
by
Stephane Nicoll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Document JMS auto configuration
Fixes gh-1445
parent
538cd906
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
4 deletions
+29
-4
spring-boot-features.adoc
spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc
+29
-4
No files found.
spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc
View file @
aa0f90ec
...
@@ -1774,7 +1774,8 @@ The `javax.jms.ConnectionFactory` interface provides a standard method of creati
...
@@ -1774,7 +1774,8 @@ The `javax.jms.ConnectionFactory` interface provides a standard method of creati
`ConnectionFactory` to work with JMS, you generally won't need to use it directly yourself
`ConnectionFactory` to work with JMS, you generally won't need to use it directly yourself
and you can instead rely on higher level messaging abstractions (see the
and you can instead rely on higher level messaging abstractions (see the
{spring-reference}/#jms[relevant section] of the Spring Framework reference
{spring-reference}/#jms[relevant section] of the Spring Framework reference
documentation for details).
documentation for details). Spring Boot also auto configures the necessary infrastructure
to send and receive messages.
...
@@ -1846,9 +1847,9 @@ resolved against their provided names.
...
@@ -1846,9 +1847,9 @@ resolved against their provided names.
[[boot-features-using-jms-
template
]]
[[boot-features-using-jms-
sending
]]
====
Using JmsTemplat
e
====
Sending a messag
e
Spring's `JmsTemplate` is auto-configured and you can
`@Autowire`
it directly into your
Spring's `JmsTemplate` is auto-configured and you can
autowire
it directly into your
own beans:
own beans:
[source,java,indent=0]
[source,java,indent=0]
...
@@ -1872,7 +1873,31 @@ own beans:
...
@@ -1872,7 +1873,31 @@ own beans:
}
}
----
----
NOTE: {spring-javadoc}/jms/core/JmsMessagingTemplate.{dc-ext}[`JmsMessagingTemplate`]
(new in Spring 4.1) can be injected in a similar manner.
[[boot-features-using-jms-receiving]]
==== Receiving a message
When the JMS infrastructure is present, any bean can be annotated with `@JmsListener` to
create a listener endpoint. If no `JmsListenerContainerFactory` has been defined, a default
one is configured automatically.
The following component creates a listener endpoint on the `someQueue` destination:
[source,java,indent=0]
----
@Component
public class MyBean {
@JmsListener(destination = "someQueue")
public void processMessage(String content) { ... }
}
----
Check {spring-javadoc}/jms/annotation/EnableJms.{dc-ext}[the javadoc of `@EnableJms`]
for more details.
[[boot-features-jta]]
[[boot-features-jta]]
== Distributed Transactions with JTA
== Distributed Transactions with JTA
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment