Introducing Spring Framework
Introducing Spring Framework Introducing Spring Framework
Chapter 11 ■ Integrating Your Spring Application with External Systems Listing 11-12 shows the rabbitmqProducer instance and the testSpringRabbitMQ_1() method. When this method is executed, it will send a document to the RabbitMQ broker by calling the rabbitmqProducer.send method. If you run Listing 11-12 with gradle :ch11:test, then you should have a message in the RabbitMQ broker. Figure 11-7 shows the queue and the message that is ready to be consumed. Figure 11-7. RabbitMQ: Queues Remember that you are pretending to be your friend that uses RabbitMQ, so how can you consume the messages from RabbitMQ? Listing 11-13 shows the XML configuration that will help you start consuming from RabbitMQ. Listing 11-13. mydocuments-context.xml
Chapter 11 ■ Integrating Your Spring Application with External Systems xsi:schemaLocation=" http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/ spring-jdbc-4.0.xsd http://www.springframework.org/schema/jms http://www.springframework.org/schema/jms/spring-jms- 4.0.xsd http://www.springframework.org/schema/rabbit http://www.springframework.org/schema/rabbit/ spring-rabbit-1.2.xsd http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/springbeans.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/ spring-context-4.0.xsd"> 166
- 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 and 148: Chapter 11 ■ Integrating Your Spr
- Page 149 and 150: 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: 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
- Page 199 and 200: Chapter 14 ■ Using Dynamic Langua
- Page 201 and 202: Chapter 15 ■ Spring Data Within Y
- Page 203 and 204: Chapter 15 ■ Spring Data Within Y
- Page 205 and 206: Chapter 15 ■ Spring Data Within Y
- Page 207 and 208: Chapter 15 ■ Spring Data Within Y
- Page 209 and 210: Chapter 15 ■ Spring Data Within Y
- Page 211 and 212: Chapter 15 ■ Spring Data Within Y
- Page 213 and 214: Chapter 15 ■ Spring Data Within Y
Chapter 11 ■ Integrating Your <strong>Spring</strong> Application with External Systems<br />
Listing 11-12 shows the rabbitmqProducer instance and the test<strong>Spring</strong>RabbitMQ_1() method. When this<br />
method is executed, it will send a document to the RabbitMQ broker by calling the rabbitmqProducer.send method.<br />
If you run Listing 11-12 with gradle :ch11:test, then you should have a message in the RabbitMQ broker.<br />
Figure 11-7 shows the queue and the message that is ready to be consumed.<br />
Figure 11-7. RabbitMQ: Queues<br />
Remember that you are pretending to be your friend that uses RabbitMQ, so how can you consume the messages<br />
from RabbitMQ? Listing 11-13 shows the XML configuration that will help you start consuming from RabbitMQ.<br />
Listing 11-13. mydocuments-context.xml<br />
<br />