You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@geode.apache.org by Phil Applegate <ph...@gmail.com> on 2018/03/13 19:48:44 UTC

Geode Function - Server Classpath

 Hi,

I am currently working on configuring Geode in a Client/Server
architecture. Is is possible to have a Function defined in a client to be
executed on the cluster (server) without the Function being on the server's
classpath? Could this be done with PDX serialization?

I am interested in doing this to achieve separation of concerns between the
client (which contains all business logic) and the cluster. Adding a
dependency from the server to the client is possible although I would
ideally like to avoid this as without careful management, circular
dependencies could be inadvertently be created.

Thanks in advance for your help.

Kind regards,

Phil

Re: Geode Function - Server Classpath

Posted by Anthony Baker <ab...@pivotal.io>.
Hi Phil!

We don’t currently support zero code deployment for executing functions.  You might want to see if @John Blum has any good ideas around this for SpringDataGeode client applications.  He’s developed some really cool annotations to automatically configure a cluster.

I know I’ve had conversations in the past about supporting this feature and it always came down to a question of security in production environments.  It might be ok for dev but prod always gets locked down.  

If you really, really want to go this route you could build a distributed classloader something like this:
https://gist.github.com/metatype/9b1f39a24e52f5c6f3e1

But I would just split the function code off into a separate repo and use `gfsh deploy`.

Anthony


> On Mar 13, 2018, at 12:48 PM, Phil Applegate <ph...@gmail.com> wrote:
> 
> Hi,
> 
> I am currently working on configuring Geode in a Client/Server architecture. Is is possible to have a Function defined in a client to be executed on the cluster (server) without the Function being on the server's classpath? Could this be done with PDX serialization?
> 
> I am interested in doing this to achieve separation of concerns between the client (which contains all business logic) and the cluster. Adding a dependency from the server to the client is possible although I would ideally like to avoid this as without careful management, circular dependencies could be inadvertently be created.
> 
> Thanks in advance for your help.
> 
> Kind regards,
> 
> Phil
> 


Re: Geode Function - Server Classpath

Posted by Akihiro Kitada <ak...@pivotal.io>.
Hello Phil,

If executing functions at servers, they need to create instances for
function classes. At least, those severs have to be able to load classes
for functions to execute actual function logics.

If it's O.K. to manage function jars from client side, why don't you use
"gfsh deply" command to register function jars from client side without any
configuration for functions at server side - as a result, those function
jars are added to server side classpath, automatically and dynamically.

Thanks, regards.



-- 
Akihiro Kitada  |  Staff Customer Engineer |  +81 80 3716 3736
Support.Pivotal.io <http://support.pivotal.io/>  |  Mon-Fri  9:00am to
5:30pm JST  |  1-877-477-2269
[image: support] <https://support.pivotal.io/> [image: twitter]
<https://twitter.com/pivotal> [image: linkedin]
<https://www.linkedin.com/company/3048967> [image: facebook]
<https://www.facebook.com/pivotalsoftware> [image: google plus]
<https://plus.google.com/+Pivotal> [image: youtube]
<https://www.youtube.com/playlist?list=PLAdzTan_eSPScpj2J50ErtzR9ANSzv3kl>


2018-03-14 4:48 GMT+09:00 Phil Applegate <ph...@gmail.com>:

> Hi,
>
> I am currently working on configuring Geode in a Client/Server
> architecture. Is is possible to have a Function defined in a client to be
> executed on the cluster (server) without the Function being on the server's
> classpath? Could this be done with PDX serialization?
>
> I am interested in doing this to achieve separation of concerns between
> the client (which contains all business logic) and the cluster. Adding a
> dependency from the server to the client is possible although I would
> ideally like to avoid this as without careful management, circular
> dependencies could be inadvertently be created.
>
> Thanks in advance for your help.
>
> Kind regards,
>
> Phil
>
>

Re: Geode Function - Server Classpath

Posted by Swapnil Bawaskar <sb...@pivotal.io>.
Hi Phil,

If what you are trying to achieve is separation of client side code vs
server side code, I would recommend that you create separate code
repositories for client side code vs server side code (functions, cache
listeners etc). You can then compile and deploy the server side repo with
the gfsh deploy command.


On Tue, Mar 13, 2018 at 12:48 PM Phil Applegate <ph...@gmail.com>
wrote:

> Hi,
>
> I am currently working on configuring Geode in a Client/Server
> architecture. Is is possible to have a Function defined in a client to be
> executed on the cluster (server) without the Function being on the server's
> classpath? Could this be done with PDX serialization?
>
> I am interested in doing this to achieve separation of concerns between
> the client (which contains all business logic) and the cluster. Adding a
> dependency from the server to the client is possible although I would
> ideally like to avoid this as without careful management, circular
> dependencies could be inadvertently be created.
>
> Thanks in advance for your help.
>
> Kind regards,
>
> Phil
>
>