Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configure an embedded RAR #3539

Closed
fcorneli opened this issue May 12, 2018 · 10 comments
Closed

Configure an embedded RAR #3539

fcorneli opened this issue May 12, 2018 · 10 comments

Comments

@fcorneli
Copy link

We've developed a JCA resource adapter for Ethereum:
https://github.com/e-Contract/ethereum-resource-adapter
and would like to add support for OpenLiberty.
Problem is that we didn't find a way to configure the JNDI binding so far.
For other application servers, this can be done via some configuration file.
See: https://github.com/e-Contract/ethereum-resource-adapter/tree/master/ethereum-rar/src/main/rar/META-INF
How can we configure this for OpenLiberty?

@frowe
Copy link
Member

frowe commented May 14, 2018

@njr-11
Copy link
Contributor

njr-11 commented May 15, 2018

First, I'll add that it's great to see you created a resource adapter for ethereum.
Based on the examples, it looks like you are aiming to pre-configure a built-in connection factory instance with a particular JNDI name as part of the resource adapter. This isn't a JCA spec standard capability and isn't something that is possible in Liberty. The standard way of doing this which will work across all JCA/EE compliant application servers is for the user to configure the JNDI name on a connection factory instance.

Here is one example of doing that in Liberty,

The following is Liberty-specific server configuration for deploying the resource adapter and defining a connection factory instance (also requires the jca-1.6 or jca-1.7 feature),

<resourceAdapter id="ethereum-ra" location="/usr/lib/ethereum-ra.rar"/>
<connectionFactory jndiName="EthereumConnectionFactory">
  <properties.ethereum-ra nodeLocation="http://localhost:8545"/>
</connectionFactory>

This will make the following possible (everything after this point is per spec and should be common to all application servers),

Direct lookup from application:
EthereumConnectionFactory ecf = InitialContext.doLookup("EthereumConnectionFactory");

Injection into web component or ejb component,

@Resource(lookup="EthereumConnectionFactory")
EthereumConnectionFactory ecf;

Resource reference defined in application deployment descriptor,

  <resource-ref>
    <res-ref-name>java:global/env/EthereumConnectionFactory</res-ref-name>
    <res-type>be.e_contract.ethereum.ra.api.EthereumConnectionFactory</res-type>
    <lookup-name>EthereumConnectionFactory</lookup-name>
  </resource-ref>

which allows lookup as follows,
EthereumConnectionFactory ecf = InitialContext.doLookup("java:global/env/EthereumConnectionFactory");

@njr-11 njr-11 removed their assignment Aug 28, 2018
@frowe
Copy link
Member

frowe commented Aug 29, 2018

Yet another proprietary extension file for OL isn't the way to solve this, it's obviously not portable. The best way to address this issue to add one or more resource defining annotations/DD elements to the connector spec and make this portable.

@frowe frowe self-assigned this Nov 20, 2018
@frowe
Copy link
Member

frowe commented Jan 15, 2019

We are continuing to have discussion around this issue.

@fcorneli
Copy link
Author

Almost all other Java EE application servers support custom JNDI binding via some config file, so why not simply add some basic liberty-ra.xml support?

@frowe
Copy link
Member

frowe commented Jan 16, 2019

That's part of the discussion. Obviously, it's not just "custom JNDI binding", we have to come up with a means to define the ConnectionFactory. All of this is doable, it's just a matter of prioritization.

@zosrothko
Copy link

Hi there... What is the status of this issue? At my company, we have also 2 JCA ResourceAdaptater targeting the IBM mainframes for CICS & IMS, and some of our customers are requesting for the integration of OpenLiberty with their mainframe. Like @fcorneli mentiioned, we are in favor of an external configuration file as liberty-ra.xml

@zosrothko
Copy link

@fcorneli Did you succeed in coupling your ResourceAdaptator to OpenLiberty?

@fcorneli
Copy link
Author

@zosrothko After my initial experiments with OpenLiberty, I gave up on trying...

@frowe
Copy link
Member

frowe commented Jan 11, 2022

As mentioned earlier, this really needs to addressed in the connector spec in order to provide the expected EE app portability. I've opened jakartaee/connectors#125 for this purpose, feel free to comment there. I'm closing this issue as we will implement it as part of any spec update that comes out of that issue.

@frowe frowe closed this as completed Jan 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants