How to make use of keep-alive in ConnectionRequest in Codename One? - codenameone

I want to use the "Connection: keep-alive" method to improve the https performance (https://en.wikipedia.org/wiki/HTTP_persistent_connection).
However I can't find anything related to the reuse of connection in ConnectionRequest and NetworkManager.
Does codename one support this? If not, any alternatives?
Thanks.

We thought about adding an official implementation of this. An undocumented API is used by the open source pubnub support for Codename One.
However with later versions we added full TCP support and websockets which seem more appropriate for this type of use case.

Related

Camel-Jetty HTTP/2 support

I've seen that Jetty now supports HTTP/2. Spent some time researching and can't see a way of implementing this in Apache Camel-Jetty. Any idea whether this is something that Camel will need to implement? Or is it configurable using their RestConfigurationDefinition?
Thanks in advance.
I'm afraid you need to do some extra work to enable the HTTP/2 feature. Camel-Jetty Components has two parts, one is Consumer (Jetty Server) and the other is Producer (Jetty Client). If you want to enable the HTTP/2 feature, you need to make sure the Http module is loaded by modifying some code. I don't think you can do it by doing some configuration with the RestConfigurationDefinition.
Please send a feature request by creating a JIRA for it.

Can I use Camel and WMQ without JMS?

I am currently learning Camel, and have a specific project in mind that requires a Websphere MQ back-end, but I can't use JMS components, since I need a lot of non-jms headers, like MQIIH.
I found the camel-wmq project.
Is it the recommended solution ? Is it any good ?
You don't need to use jms. WMQ has a client API. Just download the wmq client jars and put them in your project and use them together with your Camel routes. You will probably put the wmq client code in a processor class or something similar. Off course best to test to put a message on a queue manually via RFHUTIL or something similar as a client so you are sure the environment setup is correct.
The suggested way of working with WMQ has always been through the JMS component since it enables you to painlessly switch to other providers if the need arises.
However, if you need to use some WMQ-specific function then my suggestion would be to extend the camel-wmq library - it contains only a subset of features supported by WMQ and does not support MQIIH headers that you need. Adding functionality to a component would probably involve more work than the solution Souciance Eqdam Rashti suggested but it would be a cleaner solution and more in line with Camel's philosophy. Also, you'd be giving back to the community and thus help make Camel a better tool for everyone :)
I would also suggest you go through the IBM MQ discussions on the Camel's official user group mailing list and see if you can salvage anything.

Adding ACL support to parse4cn1

I'm working on an app written in Codename One together with the parse4cn1 library, the combination of which is a real pleasure to use. However, I need support for a few things in parse4cn1 that are not implemented, most importantly ACL and was wondering if Chidiebere has any hints on how to do this (e.g. how did you implement parse4cn1 yourself - from scratch or copying the open source Parse SDK for Android)? If I manage to do something of a decent quality I will try to share back. Thanks in advance
I never got around implementing ACLs (it's still on the TODO list). parse4cn1's interface closes resembles the Parse Android SDK interface and I'll like it to stay that way for convenience. In this case, the interface of interest would be the ParseACL which is documented here.
The actual implementation will need to be done via REST API calls.
Things to bear in mind:
We use the Android SDK API simply for defining methods and signatures for the corresponding class in ParseACL but do not use the SDKs for anything can be be done via REST.
By design, any calls requiring the master key will not be supported in parse4cn1 due to security considerations. If really needed, the functionality should be exposed via server-side cloud code.
Pull requests without unit tests for the added functionality or breaking existing tests will be rejected.
See also the Contributions section of the parse4cn1 github repo.
Good luck with your implementation and I hope to see a PR from you soon ;)
It was implemented from a Java port on top of the REST API's here but was later modified to use the SDK's to allow things like push (which are now no longer relevant).
In the past I just contributed pull a request to the project to get the fixes/features I needed. It was really easy to work with and compile.

Pass file to and from JBossAS to client

I've got client server application, with JBossAS7 and client which uses remote EJB provided by the server. I have to pass file from client to server, where it will be further processed via InputStream. Also have to pass file from server to client, where on server i get OutputStream. File size is not limited, it might be even 5GB. What can I do to implement solution to this case? Passing byte[] array seems not to be a good solution, RMI limits size what I've read. RMIIO is GPL (i need solution free for commercial use). Is http transfer the only reasonable way to do this?
edit: it seems that RMIIO was always LGPL!
You might consider setting up a Netty Server running on JBoss AS as showed in this Netty Tutorial and pass data using bare sockets.
Another option is HTTP by means of a simple HTTP Transfer using a Servlet for example.
I'd exclude EJB since they are transactional component, and admitted you managed to pass this data through RMI-IIOP, you still have to set up a huge Transactional timeout.
Hope it helps.
RMIIO is LGPL (different from just GPL), which is free for commercial use and is not viral (assuming you have not modified the rmiio library).

Easiest way to get online notifications

I have some C simulations running on my university servers and I am bored of having to sit and wait for them to end, considering they take quite a while. So I want to develop some kind of mechanism to know when they have ended. I was thinking of implementing an SMTP client with gmail, but considering I can't install anything on the system I wasn't able to add the SSL libraries to do so. I also can't remote access my desktop from outside campus. So once I leave I can't VNC y desktop.
So I was thinking if there is some way where I can rent some online space for free and be able to talk with the server through ftp or http and set add some text that the simulation has ended. That way I can check the space from home and know it ended.
I know the question is quite messy, and hope someone can help point me out to someideas.
Thanks
I'd recommend, 100webspace.com, it allows PHP and MySQL, all for free! Then just send data to it with HTTP PUT and/or GET and view the results over the interweb.
My trawling of the web consistently turns up libcurl as the library of choice for interfacing C with HTTP commands. This is a sample using it with the PUT method.
A possibility would be using a simple blog and updating it via HTTP. Just as an example, blogger supports simple messages in XML. (REST would be my first choice but XML is not that bad)
Edit:
Tumblr does support using an HTTP POST without XML.

Resources