Serialization of FHIRContext Object

We have a java console application which create FHIRContext and convert data into JSON. This is perfectly working fine. However since its console application called by external system repeatedly (each time new java process created and destroyed), the FHIRContext object recreated every time which leads to performance issue.

I understand that we should create a API service to address the problem.

In short term, is there a way to serialize FHIRContext (once created) and reuse subsequent calls to avoid building the context and improve the performance.

Please advise.

Not really, no; there’s little computational work involved in reading the context; it’s all io and reading the context. So serialisting it wouldn’t make much difference; you need to redesign and keep the context in memory somehow. That is intended to work