Mobilefirst 8.0 and scheduled tasks (similar to Quartz) - ibm-mobilefirst

I'm using MobileFirst 8.0 in my project and I'd like to add some interesting use cases... Anybody knows if there are any options to schedule tasks in MobileFirst?
I have experience with Quartz library. Is there something similar to it? Or something that the MobileFirst server provides for this purpose?
Thanks in advance and best regards

Custom tasks cannot be scheduled in MobileFirst 8.0.
You can, however, have schedulers or jobs running outside of MFP, that invokes MFP REST endpoints to execute some task/job periodically.
List of MFP REST endpoints:
REST API for the MobileFirst Server administration service
REST API for the MobileFirst Server push service
REST API for the MobileFirst runtime

Related

MobileFirst JavaAdapter on Bluemix

Recently, I have registered on IBM Bluemix. I've created a Mobile Foundation Service which also creates a Container.
I started a new MobileFirst Project on Eclipse and deployed a JavaAdapter. The adapter works fine in my machine, and the endpoint url is http://localhost:10080/{My project name}/adapters/{My adapter name}.
I went to the mfpconsole of the Mobile Foundation Service (where the url is like {my custom name}.bluemix.net/mfpconsole and uploaded the same adapter.
My question is: What is the endpoint url where I can find my adapter?
I see in this documentation:(https://www.ibm.com/support/knowledgecenter/SSHSCD_7.1.0/com.ibm.worklight.dev.doc/devref/c_adapters_endpoint.html) that there's a "Context," but I don't know where to find this "Context" name. I received the message "Context Root not found."
Thanks in advance!
You can go into your adapter in the console and view the swagger docs (View Swagger Docs).
In addition to what Dora wrote, please note that you're using Mobile Foundation service, which is based on MobileFirst Foundation 8.0, but creating Java adapters in MobileFirst Foundation 7.1
You may be able to deploy these adapters, but you will quickly find out that things have changed dramatically.
I suggest that you will follow the v8.0 documentation, including how to create adapters for v8.0: https://mobilefirstplatform.ibmcloud.com/tutorials/en/foundation/8.0/adapters/

Integration of MobileFirst Application onto BlueMix

I have a set of applications that have been developed by IBM using MobileFirst so it uses Worklight servers and adapters within the application.
I have been requested to investigate the possibilities of taking a hybrid mobile application developed on worklight and trying to migrate it onto something like IBM's BlueMix.
I was hoping someone could provide me with some insight as to how much work may be involved or if this task is even possible?
Thanks in advance.
Assuming you are using MobileFirst Platform Foundation 7.1, you can run your MobileFirst Server on IBM Containers, a technology powered by IBM Bluemix... you can read more about it here: https://mobilefirstplatform.ibmcloud.com/tutorials/en/foundation/7.1/ibm-containers/
You can start by evaluating it: https://mobilefirstplatform.ibmcloud.com/tutorials/en/foundation/7.1/ibm-containers/evaluate/
And later, assuming you are an IBM MobileFirst Platform customer, migrate your existing project and applications to it: https://mobilefirstplatform.ibmcloud.com/tutorials/en/foundation/7.1/ibm-containers/run/
You will also want to experiment with MobileFirst Foundation 8.0 beta: https://mobilefirstplatform.ibmcloud.com/beta/
v8.0 beta also provides an all-new approach for running on Bluemix: https://mobilefirstplatform.ibmcloud.com/tutorials/en/foundation/8.0/ibm-containers/using-mobile-foundation/
Using 8.0 will require some migration effort, but it'll be worth it. :)
You could migrate your adapters and the app integrated with the MFP SDk as is and move it to Bluemix using MFP 7.1 on containers. The effort is minimal - say 2 days. Based on your comments above, If you want to ditch all that and remove worklight out of the equation all altogether, you will have to hand roll all that functionality that worklight was providing to you and of course maintain it yourself. Then this ceases to be a worklight question :) and the effort is certainly more than couple of days.

How can I connect a mobilefirst application to a bluemix service?

I have developed a hybrid app on mobilefirst, and I wish to use a bluemix service. so I think the best solution is creating a nodejs app in bluemix and adding the needed service.
But I don't know how to connect both apps.
You can find online many examples describing how to use MobileFirst Adapters in order to access Bluemix services.
Review the following.
Once you when a technical question, open another.
MobileFirst Platform Foundation Labs - showing how to implement and integrate various features, including Bluemix services: https://developer.ibm.com/mobilefirstplatform/labs/
Implementation on an MobileFirst app which accesses the Watson question & answer service: https://developer.ibm.com/mobilefirstplatform/2015/04/29/using-http-adapters-to-access-watson-question-and-answer-service-at-ibm-bluemix/
Some bluemix services requires to have the app bound to your application. One way to handle this would be to deploy your MFPF Server in Bluemix using docker bound to your nodejs app, with all the services bound to it.
The idea here is your docker is bound to the nodejs, and the services are bound nodejs app, then this allow the services to be visible to the container.
This would be the case for example for SQL Database services.
Other Services are exposed outside the bounded app, such as Cloudant that has a public api for it.
To explore this observe the syntax of the command "ice group create"that you could to use to create a container group bound to app:
ice group create [-h] [--name NAME] [--memory MEMORY] [--env ENV] [--volume VOL] [--publish PORT] [--min MIN] [--max MAX] [--desired DESIRED] [--bind APP] [--auto] IMAGE [CMD [CMD ...]]
The key option would be "--bind APP". This same action could be done via the bluemix dashboard on the option to "Start Containers".
https://www.ng.bluemix.net/docs/containers/container_cli_reference_ov.html#container_cli_reference_ice__group_create
There is a sample app here that explores Watson Services + MFPF, without using the docker approach:
https://github.com/IBM-MIL/IBM-Ready-App-for-Banking

Is it possible to deploy a JAX-RS web service to MobileFirst Server?

My team is working on the migration of a hybrid app from Tibco Silver Mobile(TSM) platform to IBM MobileFirst Platform.
I have a JAX-RS webservice developed using Weblogic IDE which is currently hosted on TSM server. This webservice does a security check for all the incoming back-end requests and pass the request to the back-end if it is from a valid source.
When the app will be migrated from TSM to MobileFirst platform the TSM server will be moved out of the scene. I am looking for some alternate options for hosting this JAX-RS webservice. I don't want to make any changes to the webservice since it is a tested and proven code used in the TSM based solution.
I understand from the IBM MobileFirst Platform 7.0 documentation that JAX-RS support is now available on the MobileFirst Server and JAX-RS specification based Java adapters can be developed and deployed to the server.
Can I deploy the above mentioned webservice .WAR file as such to MobileFirst Server, without making any customizations?
If yes, what is the procedure for deploying the webservice (.WAR) to MobileFirst Server?
If no, what are the alternate options that can be considered?
As indicated in the comments above:
MFP Server is actually a Java EE application deployed to a supported Java EE application server, WebSphere Liberty or full WebSphere ND being the normal options, though TomCat is also supported.
In principle your own JAX/RS WAR file can be deployed to these same servers, the details will depend upon exactly what Java EE features you exploit and you will need to understand those Java EE servers' administration model. MFP itself is not affected by this, and you need no MFP knowledge to do it. You just need to understand the chosen Java EE server. Personally I would start with WebSphere Liberty.
A further question would be whether it is better to isolate your JAX/RS and Mobile First servers into their own Java EE server instances. It can be easier to manage and scale if you keep things separate, but technically there should be no interference if you do co-locate them. It is pretty trivial to spin up a dedicated Liberty server.
A more interesting question is whether there is value in actually exploiting the MFP Adapter capability to create JAX/RS services. In effect it's your familiar JAX/RS programming model but packaged slightly differently, deployed as a MFP adapter, and with the option explicitly to exploit the MFP security model and easily call other MFP adapters.
Personally, if I were coming to a project with no existing JAX/RS services and have commited to MFP and its security model then I would do my JAX/RS in the MFP Adapters.

Android application using worklight

I have a Tool which code is developed using "C" Language. Now i am developing Android application using worklight.I need to connect to the CICS server using TCP/IP. Here my question is, do we have any TCP/IP functionality in java script or some other language so that i can use that to develop android application?
Thanks in advance.
On the surface it sounds like that you need to connect to a Server.
In Worklight, in order to connect to a server and retrieve information from it - you use Adapters. In your case, it sounds like you need to use the HTTP adapter.
So you need to go ahead and read about Adapters in general, and then about HTTP adapters.
Developer Center: Adapters Overview
Developer Center: HTTP adapters
Knowledge Center: Developing the server side of a MobileFirst application