简体   繁体   English

Java jar(API) 或微服务 - 适用于 java 和 python 项目

[英]Java jar(API) or microservices - for java and python projects

I have a requirement to create pdf and word documents from the database.我需要从数据库中创建 pdf 和 word 文档。 This utility to create documents should be accessible from java webapp.这个用于创建文档的实用程序应该可以从 java webapp 访问。 I can create a library to expose APIs to create these documents.我可以创建一个库来公开 API 以创建这些文档。 But some of our projects are Python based, they may wants to use this utility.但是我们的一些项目是基于 Python 的,他们可能想要使用这个实用程序。 In this case they may not be able to consume java APIs.在这种情况下,他们可能无法使用 java API。 What is the best way to handle it?处理它的最佳方法是什么? We do not use docker yet.我们还没有使用 docker。 If I have to create it as microservice, how do we do that?如果我必须将其创建为微服务,我们该怎么做?

Create web application either in Java or Python and expose REST API to interact with documents. Create web application either in Java or Python and expose REST API to interact with documents. There are several frameworks from which you can choose:有几个框架可供您选择:

Python: Python:

Java: Java:

You can of course find more web api frameworks and choose the most suitable.您当然可以找到更多 web api 框架并选择最合适的。

There are also several libraries to interact with Microsoft Word:还有几个库可以与 Microsoft Word 交互:

Python: Python:

Java: Java:

And here you can also find more solutions.在这里您还可以找到更多解决方案。

REST API will be the easiest one to implement, but here are many more way to handle communication between application such as gRPC, EventBus eg AMQP or GraphQL. REST API 将是最容易实现的一种,但这里有更多处理应用程序之间通信的方法,例如 gRPC、EventBus,例如 AMQP 或 GraphQL。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM