0

I want to "open" up an application based product to enterprise integration with Camel. That is, I want customers who buy my app to be able to provide information to the app via Camel, without having to create a full public API on my App.

I've read a lot of camel documentation, examples, even the book, but I'm still having trouble getting started conceptually. First, I can get Camel running: my app has Spring support, I just don't know how to "deploy" it.

Let me set up a huge oversimplification of the use case:

  • Let's say I want my app to pop up a dialog occasionally with a message in it. My web app controls when the dialog pops up.
  • I want the message to come from some other software system that the customer owns - and I want that to be via Camel. (Could be ActiveMQ, could be email, could be a file deposited somewhere, all the stuff that Camel supports)
  • The customer has configured this message in my app at some earlier point, with a key to the message to get. So it's an InOut exchange (in Camel terms). In other words:
    • At configuration time, customer says: "I have 'foo' messages that need to be shown when the dialog pops".
    • At runtime my app says: "Hey Camel, I'm about to show a dialog, do you have a 'foo' message for me to show in it?"

That's it. Pretty simple, and I should be able to solve it easily based on what I've read, but I can't quite grasp exactly where my case falls in the examples and tutorials. I think the disconnect is that most of those are solving specific integrations problems in a specific solution. Whereas I'm opening up my app to a sort of general integration - I don’t have any details on the cusomer side of the camel.

So to get to specific questions:

  1. I'm assuming that my app needs to be a camel Endpoint, is this correct? E.g. the customer sets up a route to this dialog-popping feature in my app.

  2. Who should actually run camel in this case, the customer, my app, or both? (I think "run" camel means starting the CamelContext right? I can do this in my app, no problem, but is that what I want?)

  3. What are the specifics: Do I create a consumer or producer?

  4. What does it look like from the Customer perpsective? How do they send a message to this endpoint? How do they get the request? Does the customer need access to my API, or is Camel all they need? Do they also need to start a CamelContext?

3
  • Loose coupling means that you should create a way less specific way to integrate with the application.
    – flup
    Mar 13, 2014 at 10:06
  • how do you mean? How is opening up my application to request and get a camel message tight coupling?
    – Rhubarb
    Mar 14, 2014 at 11:19
  • You're demanding that the people calling you use Camel, rather than that they for instance use HTTP. If you add a REST or web service API, any technology can access it. Including Camel.
    – flup
    Mar 14, 2014 at 12:22

1 Answer 1

1

Q1. I'm assuming that my app needs to be a camel Endpoint, is this correct? E.g. the customer sets up a route to this dialog-popping feature in my app.

A1. That is one option, in camel terms your application would then be a camel component. However I think that would be a bad decision. You are then tying your application to be dependant on camel.

What you should do is have some interface into your application, could be a web-service, could be active-mq, etc. This is where camel would communicate with your application.

Q2. Who should actually run camel in this case, the customer, my app, or both? (I think "run" camel means starting the CamelContext right? I can do this in my app, no problem, but is that what I want?)

A1. You should develop your camel service separately to your application. It is an integration framework. They should be completely decoupled from each other. It could be started up as a separate service to your application, listening on its different endpoints (email, a-mq, file drop) and routing this information into your application exposed interface.

Q3. What are the specifics: Do I create a consumer or producer?

You would create consumers to consume the requests that are sent to your application from the customer (email, a-mq, file drop). A producer would be used to send these messages to your applications interface.

Q4. What does it look like from the Customer perspective? How do they send a message to this endpoint? How do they get the request? Does the customer need access to my API, or is Camel all they need? Do they also need to start a CamelContext?

Camel has lots of different consumers that the customer could use, it listen for emails, expose web services, wait for file drops. The customer would need access to these endpoints so they can communicate with your system. They wont need to start a camel context, camel sits behind the interfaces that you expose and routes the messages to the endpoints that you have defined.

However, do you really need all these endpoints? Would it not be more sensible to have one interface into your application that the customer could use?

4
  • Hmm thanks but not sure its exactly what I'm looking for. I have no problem with creating camel dependencies in my product. I have a bigger problem with providing a public interface (or any API) to my customer. I want this ability to specify a message to my dialog to be a feature of my app. It's not a problem if the customer has to learn Camel to do it. My problem is how do I enable that. I had looked at custom components but that seems a lot of effort for something that should be simple.
    – Rhubarb
    Mar 11, 2014 at 6:30
  • is it just the dialog, can you explain more on your use cases ?
    – Sikorski
    Mar 11, 2014 at 9:53
  • It's not even a dialog but that's the simplest way to describe use case. I want my customer to be able to configure as many of these as they want, providing information of their own for the dialog message, based on their key. Say they create one for foo and one for bar. The app now has 2 buttons called "foo" and "bar". Each time a user clicks "foo" a dialog pops and my application will call out - using camel- and say "gimme the string that goes in the 'foo' dialog". Seems pretty simple.
    – Rhubarb
    Mar 11, 2014 at 10:20
  • Camel will provide a public interface, but you can't expose a "Camel Endpoint", it will be a http endpoint, JMS Endpoint, etc. Camel sits between your application and the interface it exposes. It would be impossible for your application and the customers application to have the same CamelContext if they are on different machines. Mar 19, 2014 at 13:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.