Introducing Spring Framework
Introducing Spring Framework Introducing Spring Framework
Chapter 16 ■ Messaging with Your Spring Application Listing 16-7 shows you the JDBC XML configuration, but why are you using this JDBC if you are going to use the RabbitMQ anyway? Well, you need to have some documents to send, right? So you are going to use the ones either in the in-memory database using JDBC or the documents in the MongoDB server. So let’s also see the MongoDB XML configuration in Listing 16-8. Listing 16-8. mydocuments-mongo-context.xml In Listings 16-7 and Listing 16-8, you are going to just take the documents from the in-memory database and the MongoDB server. Next, let’s see the Marshaller bean definition, shown in Listing 16-9. This XML configuration has the beans that will help to convert your documents into XML and vice versa. Listing 16-9. mydocuments-oxm-context.xml com.apress.isf.java.model.Document 223
Chapter 16 ■ Messaging with Your Spring Application Listing 16-9 shows the xstreamMarshaller bean that is a reference to the Spring’s org.springframework.oxm. xstream.XStreamMarshaller class that you are going to use as a helper, and it is being imported in the RabbitMQ XML context. You can also see that you are using some features that the XStream library provides, like the aliases, so instead of your XML starting with , it will alias to . You can check out the “Alias Tutorial” from the XStream web site at http://xstream.codehaus.org/alias-tutorial.html. Also, the book’s companion source code includes a unit test of the OXM Marshaller. Now, let’s take a look at the special XML configuration, the RabbitMQ, shown in Listing 16-10. Listing 16-10. mydocuments-rabbitmq-context.xml 224
- 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
- Page 215 and 216: Chapter 16 ■ Messaging with Your
- Page 217 and 218: Chapter 16 ■ Messaging with Your
- Page 219: Chapter 16 ■ Messaging with Your
- Page 223 and 224: Chapter 16 ■ Messaging with Your
- Page 225 and 226: Chapter 16 ■ Messaging with Your
- Page 227 and 228: Chapter 17 Be Social and Go Mobile
- Page 229 and 230: Chapter 17 ■ Be Social and Go Mob
- Page 231 and 232: Chapter 17 ■ Be Social and Go Mob
- Page 233 and 234: Chapter 17 ■ Be Social and Go Mob
- Page 235 and 236: Chapter 17 ■ Be Social and Go Mob
- Page 237 and 238: Chapter 17 ■ Be Social and Go Mob
- Page 239 and 240: Chapter 17 ■ Be Social and Go Mob
- Page 241 and 242: Chapter 17 ■ Be Social and Go Mob
- Page 243 and 244: Chapter 17 ■ Be Social and Go Mob
- Page 245 and 246: Chapter 17 ■ Be Social and Go Mob
- Page 247 and 248: Part IV Spring I/O Spring I/O is no
- Page 249 and 250: Chapter 18 ■ Spring and Groovy
- Page 251 and 252: Chapter 18 ■ Spring and Groovy Li
- Page 253 and 254: Chapter 18 ■ Spring and Groovy cl
- Page 255 and 256: Chapter 18 ■ Spring and Groovy If
- Page 257 and 258: Chapter 18 ■ Spring and Groovy Li
- Page 259 and 260: Chapter 19 ■ Spring Boot, Simplif
- Page 261 and 262: Chapter 19 ■ Spring Boot, Simplif
- Page 263 and 264: Chapter 19 ■ Spring Boot, Simplif
- Page 265 and 266: Chapter 19 ■ Spring Boot, Simplif
- Page 267 and 268: Chapter 19 ■ Spring Boot, Simplif
- Page 269 and 270: Chapter 19 ■ Spring Boot, Simplif
Chapter 16 ■ Messaging with Your <strong>Spring</strong> Application<br />
Listing 16-9 shows the xstreamMarshaller bean that is a reference to the <strong>Spring</strong>’s org.springframework.oxm.<br />
xstream.XStreamMarshaller class that you are going to use as a helper, and it is being imported in the RabbitMQ<br />
XML context. You can also see that you are using some features that the XStream library provides, like the aliases, so<br />
instead of your XML starting with , it will alias to . You can<br />
check out the “Alias Tutorial” from the XStream web site at http://xstream.codehaus.org/alias-tutorial.html.<br />
Also, the book’s companion source code includes a unit test of the OXM Marshaller.<br />
Now, let’s take a look at the special XML configuration, the RabbitMQ, shown in Listing 16-10.<br />
Listing 16-10. mydocuments-rabbitmq-context.xml<br />
<br />
<br />
224<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />