my journey and learnings using mule esb 2

25
My journey and learnings using Mule ESB A guide by Alex Fernandez Part 2

Upload: alex-fernandez

Post on 14-Apr-2017

91 views

Category:

Software


0 download

TRANSCRIPT

Page 1: My journey and learnings using mule esb 2

My journey and learnings using Mule ESBA guide by Alex FernandezPart 2

Page 2: My journey and learnings using mule esb 2

What is all about?This are collection of the things that I learn using Mule ESB in our integration projects.

Page 3: My journey and learnings using mule esb 2

1. Integration is HardThere are no other way to describe it, integration is just hard especially dealing with different endpoints/api.

Page 4: My journey and learnings using mule esb 2

2. Mavenize your project alwaysThere is no easier way to manage your project than to mavenize it,

PLEASE DO NOT USE JAR FILES TO BE INCLUDED IN YOUR PROJECT

Page 5: My journey and learnings using mule esb 2

3. Use appropriate tools for API Testing 1. POSTMAN

2. SOAPUI

Page 6: My journey and learnings using mule esb 2

4. Use appropriate tools for API Testing 1. POSTMAN

2. SOAPUI

Page 7: My journey and learnings using mule esb 2

Resourceshttp://www.jsonschema2pojo.org/http://www.javaroots.com/2014/12/how-to-check-for-null-payload-in-mule.htmlhttps://docs.mulesoft.com/mule-user-guide/v/3.6/

Page 8: My journey and learnings using mule esb 2

My journey and learnings using Mule ESBA guide by Alex FernandezPart 2

Page 9: My journey and learnings using mule esb 2

5. In handling JSONCommon Problems

1. Garbled JSON or one liner json, use a formatter(https://jsonformatter.curiousconcept.com/)

2. JSON to POJO(http://www.jsonschema2pojo.org/)

Page 10: My journey and learnings using mule esb 2

6. Use Parse Template for simple payload constructionParse template is best solution if your going to construct payload such as json, and MEL works in template.

Page 11: My journey and learnings using mule esb 2

7. If possible, use the Null Session Handler for JMS and HTTP ConnectorWe, encountered a problem with an third party endpoint and it is return an http status of 500. With that error, it states that the request limit has been reached and we found out that we are sending the whole X_MULE_SESSION. We saw this using an interceptor plugge to ESB Server.

Page 12: My journey and learnings using mule esb 2
Page 13: My journey and learnings using mule esb 2

8. Setting an environment in ESB ServerUsually we set a variable in the ESB Server to identify where environment we are in.

Page 14: My journey and learnings using mule esb 2

Resourceshttp://www.jsonschema2pojo.org/http://www.javaroots.com/2014/12/how-to-check-for-null-payload-in-mule.htmlhttps://docs.mulesoft.com/mule-user-guide/v/3.6/

Page 15: My journey and learnings using mule esb 2

My journey and learnings using Mule ESBA guide by Alex FernandezPart 3

Page 16: My journey and learnings using mule esb 2

9. Handling NullPayload#[payload is org.mule.transport.NullPayload]

Page 17: My journey and learnings using mule esb 2

10. Complex Logic for Choice?Admit it, most of the time that our logic is complex for choice component based on the current payload.

Solution.Use a utility class to handle the logic for the choice.

Page 18: My journey and learnings using mule esb 2

11. Autowiring managed bean

Page 19: My journey and learnings using mule esb 2

12. Have an complex XML but no schema?

Most of the time we have an xml but we don’t have an schema to be used in JAXB.

Solution:http://www.freeformatter.com/xsd-generator.html#ad-output

Page 20: My journey and learnings using mule esb 2

13. Schema to POJO using JaxB

Page 21: My journey and learnings using mule esb 2

14. Deploying mule app in MMC

Page 22: My journey and learnings using mule esb 2

Resourceshttp://www.jsonschema2pojo.org/http://www.javaroots.com/2014/12/how-to-check-for-null-payload-in-mule.htmlhttps://docs.mulesoft.com/mule-user-guide/v/3.6/

Page 23: My journey and learnings using mule esb 2

My journey and learnings using Mule ESBA guide by Alex FernandezPart 3

Page 24: My journey and learnings using mule esb 2

15.

Page 25: My journey and learnings using mule esb 2

Resourceshttp://www.jsonschema2pojo.org/http://www.javaroots.com/2014/12/how-to-check-for-null-payload-in-mule.htmlhttps://docs.mulesoft.com/mule-user-guide/v/3.6/