Using Python or C for grails application

I am working on a grails application that does a lot of image processing. The working process:

  • User Uploads Image Element
  • added to the queue
  • the backend process will select an item from the queue and perform analysis on it

I came across OpenCV, which has many functions that I would like to use, however, the JavaCV java shell was used for it. pain for work. There is no documentation in Java / Scala other than a few examples. However, it has decent documentation for C or Python .

So I'm wondering if it is okay to write work queues in Python or C. Workers collected an element from a queue, processed it, and put it back in the queue so that grails could pick it up.

My questions:

  • What should I use for my turn? JMS plugin?
  • Is there anything special that needs to be done so that Python or C finds out that there is a new element in the queue? Is that what ActiveMQ is good for?
  • Do you see the main problems with my approach?
  • Any links showing this type of cross-platform demo with JMS will be appreciated.
+4
source share
2 answers
  • What should I use for my turn? JMS plugin?

I think you may run into the same problem with different queue implementations: you cannot find a good C or Python API for JMS.

Why not just use the database table as a queue?

  • Is there anything special that needs to be done so that Python or C finds out that there is a new element in the queue? Is that what ActiveMQ is good for?

Nothing special - you need to know how to work with the queue ... :-) ActiveMQ is a well-known implementation of JMS in Java-World

  • Do you see the main problems with my approach?

Not if you can handle two different languages ​​in your project. This will add complexity. And if you decide to use the JMS solution, you will also add complexity through Queue-Manager ...

Hope this helps!

+1
source

With grails 2, you can use Python code through Jython, and in Grails 3+, spring boot, using Python is much easier than grails2.

Here is some info: http://docs.spring.io/spring-python/1.2.x/sphinx/html/

0
source

All Articles