Introducing Spring Framework
Introducing Spring Framework Introducing Spring Framework
Chapter 11 ■ Integrating Your Spring Application with External Systems Figure 11-4. The “Message sent!” Message After pasting the XML contents (from Listing 11-1), see Figure 11-3. Click the Send Message button. This will send the XML message to the mydocumentsQueue; take a look at Figure 11-4. Figure 11-4 displays a “Message sent!” message in green. This means that your message is now waiting in the queue. And if you click the Browse button (next to the Send button) you can see the message listed and ready to be consumed by any client, as shown in Figure 11-5. 149
Chapter 11 ■ Integrating Your Spring Application with External Systems Figure 11-5. The Message Is Listed and Ready 150 Figure 11-5 shows the message that you sent to the queue. Spring JMS Next, you are going to create a consumer that will consume that message. The Spring Framework already has a template (for sending JMS messages to any JMS broker) and a Simple Listener container (that connects to a JMS broker and listens for any new messages incoming from a queue or topic). Listing 11-2 shows the consumer you are going to use to consume the XML message from the Apache ActiveMQ container. Listing 11-2. JMSConsumer.java package com.apress.isf.spring.jms; import javax.jms.JMSException; import javax.jms.Message; import javax.jms.MessageListener; import javax.jms.TextMessage; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component;
- Page 97 and 98: Chapter 8 ■ Give Advice to Your S
- Page 99 and 100: Chapter 8 ■ Give Advice to Your S
- Page 101 and 102: Chapter 8 ■ Give Advice to Your S
- Page 103 and 104: Chapter 8 ■ Give Advice to Your S
- Page 105 and 106: Chapter 8 ■ Give Advice to Your S
- Page 107 and 108: Chapter 8 ■ Give Advice to Your S
- Page 109 and 110: Chapter 8 ■ Give Advice to Your S
- Page 111 and 112: Chapter 9 ■ Adding Persistence to
- Page 113 and 114: Chapter 9 ■ Adding Persistence to
- Page 115 and 116: Chapter 9 ■ Adding Persistence to
- Page 117 and 118: Chapter 9 ■ Adding Persistence to
- Page 119 and 120: Chapter 9 ■ Adding Persistence to
- Page 121 and 122: Chapter 9 ■ Adding Persistence to
- Page 123 and 124: Chapter 9 ■ Adding Persistence to
- Page 125 and 126: Chapter 9 ■ Adding Persistence to
- Page 127 and 128: Chapter 9 ■ Adding Persistence to
- Page 129 and 130: Chapter 9 ■ Adding Persistence to
- Page 131 and 132: Chapter 9 ■ Adding Persistence to
- Page 133 and 134: Chapter 10 ■ Showing Your Spring
- Page 135 and 136: Chapter 10 ■ Showing Your Spring
- Page 137 and 138: Chapter 10 ■ Showing Your Spring
- Page 139 and 140: Chapter 10 ■ Showing Your Spring
- Page 141 and 142: Chapter 10 ■ Showing Your Spring
- Page 143 and 144: Chapter 10 ■ Showing Your Spring
- Page 145 and 146: Chapter 11 ■ Integrating Your Spr
- Page 147: Chapter 11 ■ Integrating Your Spr
- Page 151 and 152: Chapter 11 ■ Integrating Your Spr
- Page 153 and 154: Chapter 11 ■ Integrating Your Spr
- Page 155 and 156: Chapter 11 ■ Integrating Your Spr
- Page 157 and 158: Chapter 11 ■ Integrating Your Spr
- Page 159 and 160: Chapter 11 ■ Integrating Your Spr
- Page 161 and 162: Chapter 11 ■ Integrating Your Spr
- Page 163 and 164: Chapter 11 ■ Integrating Your Spr
- Page 165 and 166: Chapter 11 ■ Integrating Your Spr
- Page 167 and 168: Chapter 12 Exposing a REST API Nowa
- Page 169 and 170: Chapter 12 ■ Exposing a REST API
- Page 171 and 172: Chapter 12 ■ Exposing a REST API
- Page 173 and 174: Chapter 12 ■ Exposing a REST API
- Page 175 and 176: Chapter 12 ■ Exposing a REST API
- Page 177 and 178: Chapter 12 ■ Exposing a REST API
- Page 179 and 180: HTTP-DELETE Chapter 12 ■ Exposing
- Page 181 and 182: Chapter 13 Adding E-mail and Schedu
- Page 183 and 184: Chapter 13 ■ Adding E-mail and Sc
- Page 185 and 186: Chapter 13 ■ Adding E-mail and Sc
- Page 187 and 188: Chapter 13 ■ Adding E-mail and Sc
- Page 189 and 190: Chapter 13 ■ Adding E-mail and Sc
- Page 191 and 192: Part III Spring Framework Advanced
- Page 193 and 194: Chapter 14 ■ Using Dynamic Langua
- Page 195 and 196: Chapter 14 ■ Using Dynamic Langua
- Page 197 and 198: Chapter 14 ■ Using Dynamic Langua
Chapter 11 ■ Integrating Your <strong>Spring</strong> Application with External Systems<br />
Figure 11-4. The “Message sent!” Message<br />
After pasting the XML contents (from Listing 11-1), see Figure 11-3. Click the Send Message button. This will send<br />
the XML message to the mydocumentsQueue; take a look at Figure 11-4.<br />
Figure 11-4 displays a “Message sent!” message in green. This means that your message is now waiting in the<br />
queue. And if you click the Browse button (next to the Send button) you can see the message listed and ready to be<br />
consumed by any client, as shown in Figure 11-5.<br />
149