Share Spring Application context among operators

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Share Spring Application context among operators

Swapnil Dharane
Hello,

Is there any way with which I can pass my spring ApplicationContext object as parameter to flink operators? I understand I need to serialize this object.Is there any existing serialization mechanism that I can use? 

Thanks in advance.

Reply | Threaded
Open this post in threaded view
|

Re: Share Spring Application context among operators

Gordon Weakliem
The WHOLE Spring ApplicationContext? This sounds like a bad idea. Most of that stuff isn't applicable outside a Spring application. Can't you cut it down to a smaller subset that your Flink app actually needs?

On Fri, Feb 9, 2018 at 9:15 PM, Swapnil Dharane <[hidden email]> wrote:
Hello,

Is there any way with which I can pass my spring ApplicationContext object as parameter to flink operators? I understand I need to serialize this object.Is there any existing serialization mechanism that I can use? 

Thanks in advance.




--
Img
  Gordon Weakliem|  Sr. Software Engineer
  303.493.5490  
  Boulder | NYC London        



CONFIDENTIALITY. This communication is intended only for the use of the intended recipient(s) and contains information that is privileged and confidential. As a recipient of this confidential and proprietary information, you are prohibited from distributing this information outside of sovrn. Further, if you are not the intended recipient, please note that any dissemination of this communication is prohibited. If you have received this communication in error, please erase all copies of the message, including all attachments, and please also notify the sender immediately. Thank you for your cooperation.
Reply | Threaded
Open this post in threaded view
|

Re: Share Spring Application context among operators

Swapnil Dharane
Hello Gordon,

Thanks for the reply.

I do have an alternative to share BasicDataSource(from apache commons dbcp library) Object. I thought that it might be best if we leave db connection pooling outside of the actual business flow so I confiured it as a spring bean. With this way , only one class can deal with Spring context loading. However, just like ApplicationContext, It is not serializable . 

Do you think that I should serialize  BasicDataSource  object and share it across flink operators as needed ? If that is the case, then I should either use an existing custom serializer or write one myself. 

Thanks in advance ,

On Sun, Feb 11, 2018 at 10:09 PM, Gordon Weakliem <[hidden email]> wrote:
The WHOLE Spring ApplicationContext? This sounds like a bad idea. Most of that stuff isn't applicable outside a Spring application. Can't you cut it down to a smaller subset that your Flink app actually needs?

On Fri, Feb 9, 2018 at 9:15 PM, Swapnil Dharane <[hidden email]> wrote:
Hello,

Is there any way with which I can pass my spring ApplicationContext object as parameter to flink operators? I understand I need to serialize this object.Is there any existing serialization mechanism that I can use? 

Thanks in advance.




--
Img
  Gordon Weakliem|  Sr. Software Engineer
  <a href="tel:(303)%20493-5490" value="+13034935490" target="_blank">303.493.5490  
  Boulder | NYC London        



CONFIDENTIALITY. This communication is intended only for the use of the intended recipient(s) and contains information that is privileged and confidential. As a recipient of this confidential and proprietary information, you are prohibited from distributing this information outside of sovrn. Further, if you are not the intended recipient, please note that any dissemination of this communication is prohibited. If you have received this communication in error, please erase all copies of the message, including all attachments, and please also notify the sender immediately. Thank you for your cooperation.

Reply | Threaded
Open this post in threaded view
|

Re: Share Spring Application context among operators

Gordon Weakliem
I don't understand your execution model - do you have a Spring app that launches Flink embedded? What container is running the Flink application?

On Sun, Feb 11, 2018 at 9:44 PM, Swapnil Dharane <[hidden email]> wrote:
Hello Gordon,

Thanks for the reply.

I do have an alternative to share BasicDataSource(from apache commons dbcp library) Object. I thought that it might be best if we leave db connection pooling outside of the actual business flow so I confiured it as a spring bean. With this way , only one class can deal with Spring context loading. However, just like ApplicationContext, It is not serializable . 

Do you think that I should serialize  BasicDataSource  object and share it across flink operators as needed ? If that is the case, then I should either use an existing custom serializer or write one myself. 

Thanks in advance ,

On Sun, Feb 11, 2018 at 10:09 PM, Gordon Weakliem <[hidden email]> wrote:
The WHOLE Spring ApplicationContext? This sounds like a bad idea. Most of that stuff isn't applicable outside a Spring application. Can't you cut it down to a smaller subset that your Flink app actually needs?

On Fri, Feb 9, 2018 at 9:15 PM, Swapnil Dharane <[hidden email]> wrote:
Hello,

Is there any way with which I can pass my spring ApplicationContext object as parameter to flink operators? I understand I need to serialize this object.Is there any existing serialization mechanism that I can use? 

Thanks in advance.




--
Img
  Gordon Weakliem|  Sr. Software Engineer
  <a href="tel:(303)%20493-5490" value="+13034935490" target="_blank">303.493.5490  
  Boulder | NYC London        



CONFIDENTIALITY. This communication is intended only for the use of the intended recipient(s) and contains information that is privileged and confidential. As a recipient of this confidential and proprietary information, you are prohibited from distributing this information outside of sovrn. Further, if you are not the intended recipient, please note that any dissemination of this communication is prohibited. If you have received this communication in error, please erase all copies of the message, including all attachments, and please also notify the sender immediately. Thank you for your cooperation.




--
Img
  Gordon Weakliem|  Sr. Software Engineer
  303.493.5490  
  Boulder | NYC London        



CONFIDENTIALITY. This communication is intended only for the use of the intended recipient(s) and contains information that is privileged and confidential. As a recipient of this confidential and proprietary information, you are prohibited from distributing this information outside of sovrn. Further, if you are not the intended recipient, please note that any dissemination of this communication is prohibited. If you have received this communication in error, please erase all copies of the message, including all attachments, and please also notify the sender immediately. Thank you for your cooperation.