You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by "javastuff.sam@gmail.com" <ja...@gmail.com> on 2017/01/18 02:12:40 UTC

Ignite REST with JBOSS

Hi 

We are using Ignite in our application which runs on top of JBOSS.
Application starts Ignite server pragmatically. 
Is there a way to use Ignite REST-HTTP module?

-Sam 



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Ignite-REST-with-JBOSS-tp10108.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: Ignite REST with JBOSS

Posted by "javastuff.sam@gmail.com" <ja...@gmail.com>.
Created improvement ticket -  IGNITE-4586
<https://issues.apache.org/jira/browse/IGNITE-4586>  



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Ignite-REST-with-JBOSS-tp10108p10162.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: Ignite REST with JBOSS

Posted by "javastuff.sam@gmail.com" <ja...@gmail.com>.
I had looked at this again, here is what I think -
1. No embedded JETTY server
2. Custom plug-able endpoint handler 

Plug-able GridRestProcessor will be overkill. However customizable
HTTP_PROTO_CLS should be good enough to plug custom rest handler. In 1.7 I
see it is hard coded to Jetty.

private static final String HTTP_PROTO_CLS =
       
"org.apache.ignite.internal.processors.rest.protocols.http.jetty.GridJettyRestProtocol";

May be enhancement for future. 

Thanks,
-Sam





--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Ignite-REST-with-JBOSS-tp10108p10147.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: Ignite REST with JBOSS

Posted by vkulichenko <va...@gmail.com>.
Hi Sam,

That's an interesting point. Ignite provides plugin framework (see
org.apache.ignite.plugin package), which allows to add new components to
Ignite. However, this way you will completely replace REST processor with
something new, while you only want to make the endpoint pluggable. Would you
like to create a ticket with a design proposal?

-Val



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Ignite-REST-with-JBOSS-tp10108p10135.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: Ignite REST with JBOSS

Posted by "javastuff.sam@gmail.com" <ja...@gmail.com>.
Hi Val,

Application is already running on top of JBOSS, so no need of another HTTP
server. 

Without connector configuration GridRestProcessor will not initialize. So I
had to initialize  Grid*CommandHandlers separately after Ignition.start() 

final GridKernalContext ctx = ((IgniteKernal)ignite).context();
... new GridCacheCommandHandler(ctx);
... new GridTaskCommandHandler(ctx);
... new GridTopologyCommandHandler(ctx);
... new GridVersionCommandHandler(ctx);
... new DataStructuresCommandHandler(ctx);
... new QueryCommandHandler(ctx);
... new GridLogCommandHandler(ctx);

and written a new REST controller which is similar to GridJettyRestHandler
with smallest change to handle request -

GridRestCommandHandler hnd =
CacheManager.getInstance().getRestCommandHandlers().get(cmdReq.command());
cmdRes = hnd.handleAsync(cmdReq).get();


Things are working fine. However I guess other functionalities from
GridRestProcessor are not available, like timeoutChecker, security, etc ... 

Plug-able custom rest processor would have been better.

Thanks,
-Sam 
 






--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Ignite-REST-with-JBOSS-tp10108p10131.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: Ignite REST with JBOSS

Posted by vkulichenko <va...@gmail.com>.
Hi Sam,

Ignite starts its own HTTP server for rest API, so it's definitely possible
when running in JBoss as well as anywhere else. You just need to add
ignite-rest-http module with dependencies to classpath and the endpoint will
start automatically.

If you're using Maven, add this to pom.xml:

<dependency>
    <groupId>org.apache.ignite</groupId>
    <artifactId>ignite-rest-http</artifactId>
    <version>${ignite.version}</version>
</dependency>

-Val



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/Ignite-REST-with-JBOSS-tp10108p10130.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.