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

Updated module exports #17

Merged
merged 7 commits into from
Apr 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ listApiChanges:
approveApiChanges:
./gradlew :revapiAcceptAllBreaks --justification $(CHANGE_JUSTIFICATION)

install:
./gradlew publishToMavenLocal

verify:
./gradlew verify

Expand Down
64 changes: 28 additions & 36 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,60 +6,51 @@ A Java API for iCalendar transport protocol integrations.

## Overview

Whilst iCal4j provides support for data interoperability via the iCalendar specifation,
we also need shared transport protocols to exchange data between applications. There are many
proven [Enterprise Integration Patterns] in use today, and this project provides
support for some of the more common integration approaches.
Where the main iCal4j library provides support for data interoperability via the iCalendar specification,
this library focuses on transport protocols and patterns to exchange data between applications. There are many
proven [Enterprise Integration Patterns] in use today, and this project provides support for some of these common
integration approaches.

### Messaging Polling Model
### Message Producer

The most common means of exchanging iCalendar data is via Email, which is a form of
asynchronous message queue. Messages are retrieved via polling the "queue" (i.e. Inbox)
and iCalendar data is extracted from attachments, etc.

### Publish/Subscribe Model
A common use case for iCal4j is to send calendar invites via email to attendees. The `ChannelAdapter` interface
defines a common contract for sending data via email, or other implementations of underlying transport protocols.

Another common pattern for exchanging data asynchronously is the Publish/Subscribe model, whereby
data is published to a shared channel and subscribers listen on that channel. A message
Topic is a common implementation of this, and is supported by many queue implementations.

### Webhooks

Webhooks are a special type of Publish/Subscribe model, whereby the publishing target is
configured per subscriber. As such it is usually implemented as a single-subscriber
pubsub model.
### Message Polling

## Usage
The most common method of exchanging iCalendar data is email, which is a kind of
asynchronous message queue. Messages are retrieved via polling the "queue" (i.e. Inbox)
and iCalendar data is extracted from attachments.

The iCal4j Integration API provides two primary interfaces that support the implementation
of the different integration models described above. These interfaces are implemented by
most of the concrete integrations and aim to simplify the integration with different
transport mechanisms.
Implementations of the `ChannelConsumer` interface provide support for message polling, whilst abstracting the
complexities of the underlying transports.

### Channel Adapter

The Channel Adapter interface supports sending or receiving data. It
defines methods used to publish and consume messages via the integration point.
### Reactive Streams

### Channel Subscriber
Java Reactive Streams provides support for the Publisher/Subscriber pattern, which is another asynchronous
messaging pattern for sharing data with multiple consumers.

The Channel Subscriber interface provides support for subscribers via the Publish/Subscribe model.
Implementors of the `ChannelPublisher` interface provide support for subscribing multiple consumers to a data
stream.


## Examples

### HTTP
### Webhooks

Publish calendar object to HTTP target:
Publish calendar object to webhook target:

Calendar calendar = ...
ChannelAdapter<Calendar> producer = new ApacheHttpClientAdapter(null, "POST", "http://ical.example.com");
producer.send(calendar);
producer.publish(() -> calendar);

Consume calendar object from HTTP endpoint:

ChannelAdapter<Calendar> consumer = new ApacheHttpClientAdapter("http://tzurl.org/zoneinfo/Australia/Melbourne");
Calendar calendar = consumer.poll(30);
Calendar calendar = null;
ChannelConsumer<Calendar> consumer = new ApacheHttpClientAdapter("http://tzurl.org/zoneinfo/Australia/Melbourne");
Calendar calendar = consumer.accept(c -> calendar = c, 30);


### Email
Expand All @@ -73,11 +64,12 @@ Publish calendar object via email:

Consume calendar object delivered to an email address:

Calendar calendar = null;
Session session = ...
ChannelAdapter<Calendar> consumer = new JakartaMailAdapter(session);
Calendar calendar = consumer.poll(30);
ChannelConsumer<Calendar> consumer = new JakartaMailAdapter(session);
Calendar calendar = consumer.consume(c -> calendar = c, 30);

Listen for calendar objects delivered to an email address:
Subscribe to calendar objects delivered to an email address:

TBD.

Expand Down
3 changes: 1 addition & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,7 @@ iCalendar support for integration architectures like Apache Camel

testImplementation platform("org.spockframework:spock-bom:$spockVersion"),
"org.spockframework:spock-core",
"org.slf4j:slf4j-log4j12:$slf4jVersion",
"org.apache.logging.log4j:log4j:$log4jVersion"
"org.apache.logging.log4j:log4j-core:$log4jVersion"

// testcontainers
testImplementation "org.testcontainers:testcontainers:$testcontainersVersion",
Expand Down
1 change: 0 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ camelVersion=3.8.0
quartzVersion=2.3.2
groovyVersion=3.0.17
romeVersion=1.17.0
slf4jVersion = 2.0.7
log4jVersion = 2.20.0
javamailVersion = 2.0.1
awsSdkVersion = 1.12.220
Expand Down
2 changes: 2 additions & 0 deletions ical4j-integration-mail/src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@

requires jakarta.mail;
requires org.slf4j;

exports org.ical4j.integration.mail;
}
Loading