0

I want to make Integration between Salesforce and ActiveMQ(Is is a messaging server where the company send and save messages in this service).

The Context:

Every 5 Minutes should salesforce a request to ActiveMQ send to bring the message from ActiveMQ to salesforce, where salesforce will hanlde the message to extract Information from it.

The Question: What is the best design patter to achieve that? I read about many pattern, but I do not what is the best.

closed as primarily opinion-based by Reshma, battery.cord, Pranay Jaiswal, Raul, Markus Slabina Feb 14 at 13:33

Many good questions generate some degree of opinion based on expert experience, but answers to this question will tend to be almost entirely based on opinions, rather than facts, references, or specific expertise. If this question can be reworded to fit the rules in the help center, please edit the question.

  • Do you want SF to poll ActiveMQ? – Pranay Jaiswal Feb 11 at 11:19
  • Yes I want that @PranayJaiswal – AZIZ Feb 11 at 11:19
  • 1
    We there are Apex Scheduler that allows you to perform a job periodically, You might wanna investigate that: developer.salesforce.com/docs/atlas.en-us.apexcode.meta/… – Pranay Jaiswal Feb 11 at 11:50
  • 3
    I would say the best design pattern is to use some middleware solution to monitor ActiveMQ and push messages to Salesforce over the API. See this question for some of the challenges related to scheduling Apex on a tight schedule. Salesforce is not well suited to this activity. – David Reed Feb 11 at 12:34
  • Alternatively, instead of pulling data after Salesforce's initiated request... you can push data from server to Salesforce where you have hosted ActiveMQ - where you can run your cron job to run after each 5 minutes. – Ayub Feb 11 at 12:45
1

I think this design architecture is a mistake. (Disclaimer: I don't have experience with ActiveMQ).

I would say the best design pattern is to use some middleware solution to monitor ActiveMQ and push messages to Salesforce over the API. It is possible, albeit far more complicated than you would expect, to schedule code to run every five minutes. See this question for some of the challenges and techniques related to scheduling Apex on a tight schedule.

Even then, you are subject to the vagaries of server load and Salesforce's internal balancing systems. You have no guarantee that any form of asynchronous Apex - Scheduled or Queueable, future or Batch - will execute on the specific schedule that you are hoping for, and the performance you observe will vary from time to time. If you are building a system that depends on very regular updates in Salesforce, you're setting yourself up for a lot of support and maintenance challenges as you move forward.

Salesforce is not well suited to this activity. It's much more sustainable to use a general-purpose server or middleware platform to support Salesforce.

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