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

Support for creating connector spec resources like ConnectionFactory in Resource Adapters #125

Open
frowe opened this issue Dec 11, 2021 · 2 comments

Comments

@frowe
Copy link

frowe commented Dec 11, 2021

Just as it can be useful to package (embed) a resource adapter and an application together, it could also be useful to be able to allow resource adapters to create what would normally be application defined resources like @ConnectionFactoryDefinition and @ConnectionFactoryDefinitions. This would allow the creation of a self-contained ear that could be deployed to any jakarta ee compliant app server w/o having to deal with server config.

@frowe frowe changed the title Support for resource adapter defined resources like ConnectionFactory Support for application defined resources of connectors like ConnectionFactory Dec 11, 2021
@frowe frowe changed the title Support for application defined resources of connectors like ConnectionFactory Support for creating connector spec resources like ConnectionFactory in Resource Adapters Dec 13, 2021
@smillidge
Copy link
Contributor

Do you have any examples of what this would look like?

Payara can do this in the application using code like below and this doesn't require any additional server config.

@ConnectionFactoryDefinition(name = "java:comp/env/KafkaConnectionFactory", 
  description = "Kafka Conn Factory", 
  interfaceName = "fish.payara.cloud.connectors.kafka.api.KafkaConnectionFactory", 
  resourceAdapter = "kafka-rar-0.6.1-SNAPSHOT", 
  minPoolSize = 2, 
  maxPoolSize = 2,
  transactionSupport = TransactionSupportLevel.NoTransaction,
  properties = {"acks=all"
  })

Would we support the same annotations somewhere in the RAR?

@njr-11
Copy link
Contributor

njr-11 commented Feb 15, 2022

If we did this, I could see putting them on the resource adapter's ManagedConnectionFactory implementation class alongside where it declares the @ConnectionDefinition annotation, in which case interfaceName as well as resourceAdapter attributes could be made optional,

@ConnectorDefinition(connectionFactory = KafkaConnectionFactory.class, ...)
@ConnectionFactoryDefinition(name = "java:comp/eis/KafkaConnectionFactory", 
  description = "Kafka Conn Factory", 
  minPoolSize = 2, 
  maxPoolSize = 2,
  transactionSupport = TransactionSupportLevel.NoTransaction,
  properties = {"acks=all"}
)
public class MyKafkaManagedConnectionFactory implements ManagedConnectionFactory ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants