udp-jca-adapter-parent


License

License

GroupId

GroupId

com.github.exabrial
ArtifactId

ArtifactId

udp-jca-adapter-parent
Last Version

Last Version

1.1.0
Release Date

Release Date

Type

Type

pom
Description

Description

udp-jca-adapter-parent
udp-jca-adapter-parent
Project URL

Project URL

https://github.com/exabrial/udp-jca-adapter
Source Code Management

Source Code Management

https://github.com/exabrial/udp-jca-adapter/tree/master

Download udp-jca-adapter-parent

How to add to project

<!-- https://jarcasting.com/artifacts/com.github.exabrial/udp-jca-adapter-parent/ -->
<dependency>
    <groupId>com.github.exabrial</groupId>
    <artifactId>udp-jca-adapter-parent</artifactId>
    <version>1.1.0</version>
    <type>pom</type>
</dependency>
// https://jarcasting.com/artifacts/com.github.exabrial/udp-jca-adapter-parent/
implementation 'com.github.exabrial:udp-jca-adapter-parent:1.1.0'
// https://jarcasting.com/artifacts/com.github.exabrial/udp-jca-adapter-parent/
implementation ("com.github.exabrial:udp-jca-adapter-parent:1.1.0")
'com.github.exabrial:udp-jca-adapter-parent:pom:1.1.0'
<dependency org="com.github.exabrial" name="udp-jca-adapter-parent" rev="1.1.0">
  <artifact name="udp-jca-adapter-parent" type="pom" />
</dependency>
@Grapes(
@Grab(group='com.github.exabrial', module='udp-jca-adapter-parent', version='1.1.0')
)
libraryDependencies += "com.github.exabrial" % "udp-jca-adapter-parent" % "1.1.0"
[com.github.exabrial/udp-jca-adapter-parent "1.1.0"]

Dependencies

provided (1)

Group / Artifact Type Version
org.projectlombok : lombok jar 1.18.12

Project Modules

  • udp-jca-adapter-api
  • udp-jca-adapter
  • udp-jca-adapter-rar

udp-jca-adapter

Description

A JCA 1.7 compliant Resource Adapter RAR to accept UDP packets with full modern Java EE facilities in a fast memory safe language.

Motivation / Use Case

Do you want to accept UDP connections in Java, but have full access to CDI, JAX-RS, JPA, SQL, JTA, etc?

Simply implement the UDPMessageListener interface:

import java.math.BigInteger;
import java.net.InetAddress;

import javax.ejb.MessageDriven;

@MessageDriven
public class UDPDumper implements UDPMessageListener {
   @Inject
   private Logger log;

	@Override
	public byte[] onPacket(final byte[] payload, final InetAddress sourceAddress) {
		log.info("onPacket() UDP packet from:{}", sourceAddress.getHostAddress());
		return null;
	}
}

Maven Coordinates

The API jar contains the interface you need to implement.

		<dependency>
			<groupId>com.github.exabrial</groupId>
			<artifactId>udp-jca-adapter-api</artifactId>
			<version>1.1.0</version>
			<scope>compile</scope>
		</dependency>

Installation

RAR installation by app server differs greatly by server. Most of the time you install a JCA adapter at the EAR or server level.

Easiset deployment: Apache TomEE 8.0.4+ embedded war deployment

To deploy at the Application level, add the following to your app's pom.xml, then copy the ra.xml from the into your WEB-INF directory.

		<dependency>
			<groupId>com.github.exabrial</groupId>
			<artifactId>udp-jca-adapter</artifactId>
			<version>1.1.0</version>
			<scope>runtime</scope>
		</dependency>

Configuration

config option type default
port int 5553
maxPacketSize int 512
address String localhost

Versions

Version
1.1.0
1.0.0