Skip to content

Commit

Permalink
Feature/fs 5753 sync with remote take 3 (conductor-oss#75)
Browse files Browse the repository at this point in the history
* Feature - use environment variable to set ES6 support mode for Nashorn script evaluator (conductor-oss#88)

Use environment variable CONDUCTOR_NASHORN_ES6_ENABLED=true  to set ES6 support mode for Nashorn script evaluator.

* Fix an issue with the postgres indices as they weren't being used properly (conductor-oss#92)

* Upgrade the postgres lib to prevent CVE-2024-1597 (conductor-oss#94)

* Enable finer-grained control over the postgres indexing and searching (conductor-oss#93)

* Enable the searching of the JSON field in Postgres to be configured

* Enable the indexing of tasks to be enabled / disabled

* Implement removeWorkflow for postgres index

* Enable the migration to run without always recreating an index (conductor-oss#98)

* Feature: Use TaskStatusListener.onTaskInProgress()  (conductor-oss#58)

* apply task-task-status-listener

* fix test error

* prevent NPE

* Fix SpringBoot imports file location error (conductor-oss#89)

* Implementation of Postgres PollDataDAO with read and write caching (conductor-oss#82)

* Initial implementation of an experimental queue optimisation using Postgres LISTEN/NOTIFY (conductor-oss#87)

* Initial implementation of an experimental queue optimisation using Postgres LISTEN/NOTIFY

* Use Optional instead of returning null for getSize()

* Update connection method for queue listener to make it more thread safe

* Only apply the queue notify migrations if configured

* Update the postgres docs with all configurable properties (conductor-oss#99)

* Fix ElasticSearch health check failure when ES sets password (conductor-oss#59)

* Add option to only index workflows on Postgres when their status changes (conductor-oss#83)

* Adding redis username support for clusters (conductor-oss#105)

Co-authored-by: Anup Chatterjee <[email protected]>

* Update README.md

* Fix PostgresIndexQueryBuilder null pointer exception (conductor-oss#116)

* Throw IllegalArgumentException when query string does not match regex

* Unit test for exception

* Update README.md (conductor-oss#113)

* Add a migration to relax the size constraint on task_index columns (conductor-oss#114)

* Fix of exception handler trying to write response to a disconnected client (conductor-oss#109)

Why:
On Conductor server side, an exception gets raised
`Failure in @ExceptionHandler com.netflix.conductor.rest.controllers.ApplicationExceptionMapper#handleAll(HttpServletRequest, Throwable)`.
Cause is attempting to write while the client aborted the connection
`org.apache.catalina.connector.ClientAbortException: java.io.IOException: Broken pipe`

What:
Added a ClientAbortException handler.

Testing done: Local run. Not trivial to emulate the issue in a test.
Such a test may rely on timing out the client before server responded.

Signed-off-by: Iva Avramova <[email protected]>

* Workflow bulk deletion API and action module options (conductor-oss#110)

* Initial commit to add bulk workflow deletion

* Added an API endpoint for bulk deletion

* Add archiveworkflow param

* Added bulk delete action to BulkActionModule

* Added archive option to bulk delete

* Addition of terminateRemove() Functions (conductor-oss#9)

* Added an API endpoint for bulk deletion

* Fixed WorkflowBulkServiceTest, added test cases for deleteWorkflow an… (conductor-oss#10)

* Fixed WorkflowBulkServiceTest, added test cases for deleteWorkflow and terminateRemove, and added WorkflowResourceTest test for single terminateRemove

* pass spotlessjava

---------

Co-authored-by: JeffP <[email protected]>

---------

Co-authored-by: jeffp1 <[email protected]>
Co-authored-by: Ayush Thengne <[email protected]>
Co-authored-by: Jeff P <[email protected]>
Co-authored-by: Doe1111 <[email protected]>

* Join task fixes (conductor-oss#117)

* fix join completing with errors when a task has failed or some tasks are not terminal yet

* add more tests

* add more comments to join routine

* mark join task synchronous

* Implement postgres lock DAO

* add postgres locking mention in docs

* rename locking db migration

* refactor query - the pg now() function is already UTC

* fix test

* fix pg query

* simplify query

* fix tests

* timeunit ms

* fix tests

* fix formatting

* Workflow and task status notifier

Co-authored-by: ToastedTaco <[email protected]>
Co-authored-by: BabyBlue0214 <[email protected]>
Co-authored-by: Elijah Spicer <[email protected]>

* revert WorkflowDef changes

* Revert unrelated changes

* Status Notifier Properties Cleanup

* update the tests for the JOIN task fix

* Fix the name of the task index migration

* Update README.md

* Update README.md

* Wrap PGExecutionDAO createTasks in a single transaction

* publish roadmap

* add link to the roadmap

* Create codacy.yml

* if status-listener error, task not executed

* change the point of cancellation

* Delete .github/workflows/codacy.yml

* Fix of exception handler trying to write response to a disconnected client

Why:
On Conductor server side, an exception gets raised
`Failure in @ExceptionHandler com.netflix.conductor.rest.controllers.ApplicationExceptionMapper#handleAll(HttpServletRequest, Throwable)`.
Cause is attempting to write while the client aborted the connection
`org.apache.catalina.connector.ClientAbortException: java.io.IOException: Broken pipe`, while the exception was wrapped in `ClosedChannelException`.

What:
Added a ClosedChannelException handler for such exceptions root caused by
ClientAbortException.

Testing done: Local run. Not trivial to emulate the issue in a test.
Such a test may rely on timing out the client before server responded.

Signed-off-by: Iva Avramova <[email protected]>

* Fix of exception handler trying to write response to a disconnected client

Why:
On Conductor server side, an exception gets raised
`Failure in @ExceptionHandler com.netflix.conductor.rest.controllers.ApplicationExceptionMapper#handleAll(HttpServletRequest, Throwable)`.
Cause is attempting to write while the client aborted the connection
`org.apache.catalina.connector.ClientAbortException: java.io.IOException: Broken pipe`, while the exception was nested in `ClosedChannelException`.

What:
Added a ClosedChannelException handler for exception chain containing
ClientAbortException.

Testing done: Local run. Not trivial to emulate the issue in a test.
Such a test may rely on timing out the client before server responded.

Signed-off-by: Iva Avramova <[email protected]>

* added tests; generalized the exception

Signed-off-by: Iva Avramova <[email protected]>

* added tests; generalized the exception

Signed-off-by: Iva Avramova <[email protected]>

* Why:
Ignoring a particular exception based on its stack trace
should be rather an alerting concern.

What:
Reverted ClientAbortedException specific handler.
Added test coverage for the existing exception handler.

Testing done: local run

Signed-off-by: Iva Avramova <[email protected]>

* Fix for concurrentExecLimit

* Bump io.micrometer:micrometer-registry-datadog from 1.12.1 to 1.13.0

Bumps [io.micrometer:micrometer-registry-datadog](https://github.com/micrometer-metrics/micrometer) from 1.12.1 to 1.13.0.
- [Release notes](https://github.com/micrometer-metrics/micrometer/releases)
- [Commits](micrometer-metrics/micrometer@v1.12.1...v1.13.0)

---
updated-dependencies:
- dependency-name: io.micrometer:micrometer-registry-datadog
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

* Added logic to remove stale iteration outputs based on keepLastN parameter

* Remove unused code block

* Remove unused code block

* Fixed formatting issues

* Updating DoWhileTask keepLastN iteration endIndex

* fix: Fix error with headers in webhook

* style: Fix style

* Bump com.diffplug.spotless from 5.0.0 to 6.25.0

Bumps com.diffplug.spotless from 5.0.0 to 6.25.0.

---
updated-dependencies:
- dependency-name: com.diffplug.spotless
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>

* Make sub workflow task sync

* assertion

* fix sub workflow tests

* remove not required pop

* rerun test fix.

* more fixes.

* fixes

* fixes

* Sub workflow sync test fix.

Since the ordering of the task can be different. The integration_task_2 will be polled and completed.

* added in other tests

* Update directed-acyclic-graph.md

* clean up

* added additional configuration properties, error listener, proper handling of queue groups

* fix: spotless apply

* fix webhook property validation

 - parameterizing log with placeholder

* fix: logging of connection failures due to bad evaluation of a string comparison

* update from Orkes

* clean up

* update tests

* updates to the classes

* updates

* back to async

* update tests

* add AfterburnerModule

* formatting

* fix tests

* Added test for decider completion logic: a workflow with all optional tasks in terminal state should be COMPLETED

* Adding back AfterburnerModule to ObjectMapperConfiguration. This instance is the one that Spring Boot is going to inject to its beans.

* update README

* FS-5753 Updated application.properties per feedback in last PR that was declined https://github.com/euc-data/mirror.conductor/pull/69/files#diff-0d50f15e65cc4f2001605e2f6f29edb9c2d73e1d5864cc3b7fe6d3dc385839a0

---------

Signed-off-by: Iva Avramova <[email protected]>
Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: Vasiliy Pankov <[email protected]>
Co-authored-by: Ben Pirt <[email protected]>
Co-authored-by: Hoony <[email protected]>
Co-authored-by: Young-Zen <[email protected]>
Co-authored-by: Anup Chatterjee <[email protected]>
Co-authored-by: Anup Chatterjee <[email protected]>
Co-authored-by: Viren Baraiya <[email protected]>
Co-authored-by: omadaan <[email protected]>
Co-authored-by: Riza Farheen <[email protected]>
Co-authored-by: ivakoleva <[email protected]>
Co-authored-by: Olivia Bailey <[email protected]>
Co-authored-by: jeffp1 <[email protected]>
Co-authored-by: Ayush Thengne <[email protected]>
Co-authored-by: Jeff P <[email protected]>
Co-authored-by: Doe1111 <[email protected]>
Co-authored-by: Bert Verstraete <[email protected]>
Co-authored-by: CollinDewey <[email protected]>
Co-authored-by: ToastedTaco <[email protected]>
Co-authored-by: BabyBlue0214 <[email protected]>
Co-authored-by: Elijah Spicer <[email protected]>
Co-authored-by: Martini <[email protected]>
Co-authored-by: manan164 <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Srihari Malagi <[email protected]>
Co-authored-by: Srihari K. Malagi <[email protected]>
Co-authored-by: Juan Cruz <[email protected]>
Co-authored-by: RizaFarheen <[email protected]>
Co-authored-by: astelmashenko <[email protected]>
Co-authored-by: Marcellus <[email protected]>
Co-authored-by: Fabio Scippacercola <[email protected]>
Co-authored-by: Miguel Prieto <[email protected]>
  • Loading branch information
1 parent 8fc3f8c commit 6aada8b
Show file tree
Hide file tree
Showing 142 changed files with 5,686 additions and 907 deletions.
90 changes: 37 additions & 53 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
![Conductor](docs/img/logo.svg)

[![Github release](https://img.shields.io/github/v/release/Netflix/conductor.svg)](https://GitHub.com/Netflix/conductor/releases)
[![Github release](https://img.shields.io/github/v/release/conductor-oss/conductor.svg)](https://GitHub.com/Netflix/conductor-oss/releases)
[![License](https://img.shields.io/github/license/conductor-oss/conductor.svg)](http://www.apache.org/licenses/LICENSE-2.0)


Conductor is a platform _originally_ created at Netflix to orchestrate microservices and events.
Conductor OSS is maintained by the team of developers at [Orkes](https://orkes.io/) along with the members of the open source community.

The latest version is [![Github release](https://img.shields.io/github/v/release/conductor-oss/conductor.svg)](https://GitHub.com/conductor-oss/conductor/releases)
## Conductor OSS
This is the new home for the Conductor open source going forward (previously hosted at Netflix/Conductor).
> [!IMPORTANT]
> Going forward, all the bug fixes, feature requests and security patches will be applied and released from this repository.

The last published version of Netflix Conductor will be **3.15.0** which we will continue to support.
_The last published version of Netflix Conductor will be **3.15.0** which we will continue to support._

If you would like to participate in the roadmap and development, [please reach out](https://forms.gle/P2i1xHrxPQLrjzTB7).

Expand All @@ -22,71 +20,57 @@ Show support for the Conductor OSS. Please help spread the awareness by starrin

[![GitHub stars](https://img.shields.io/github/stars/conductor-oss/conductor.svg?style=social&label=Star&maxAge=)](https://GitHub.com/conductor-oss/conductor/)

## Update your local forks/clones
Please update your forks to point to this repo. This will ensure your commits and PRs can be send against this repository
```shell
git remote set-url origin https://github.com/conductor-oss/conductor
```
> [!IMPORTANT]
> **Follow the steps below if you have an active PR against the Netflix/Conductor repository**
> 1. Fork **this** repository
> 2. Update your local repository to change the remote to this repository
> 3. Send a PR against the `main` branch
## Getting Started

## Releases
The latest version is [![Github release](https://img.shields.io/github/v/release/conductor-oss/conductor.svg)](https://GitHub.com/conductor-oss/conductor/releases)
### Using Docker (Recommended)
Follow the steps below to launch the docker container:

The next scheduled release is in Feb 2024.
```shell
docker compose -f docker/docker-compose.yaml up
```
* Navigate to http://localhost:5000 once the container starts to launch UI.
* APIs are accessible at http://localhost:8080
* Swagger Docs:http://localhost:8080/swagger-ui/index.html?configUrl=/api-docs/swagger-config#/

## Resources
#### [Slack Community](https://join.slack.com/t/orkes-conductor/shared_invite/zt-xyxqyseb-YZ3hwwAgHJH97bsrYRnSZg)
We have an active [community](https://join.slack.com/t/orkes-conductor/shared_invite/zt-xyxqyseb-YZ3hwwAgHJH97bsrYRnSZg) of Conductor users and contributors on the channel.
#### [Documentation Site](https://docs.conductor-oss.org/)
[Documentation](https://docs.conductor-oss.org/) and tutorial on how to use Conductor
## Database Requirements

[Discussion Forum](https://github.com/conductor-oss/conductor/discussions): Please use the forum for questions and discussing ideas and join the community.
* The default persistence used is Redis
* The indexing backend is [Elasticsearch](https://www.elastic.co/) (7.x)

### Conductor SDKs
Conductor supports creating workflows using JSON and Code.
SDK support for creating workflows using code is available in multiple languages and can be found at https://github.com/conductor-sdk
## Configuration for various database backends

| Backend | Configuration |
|----------------|---------------------------------------------------------------------------------------|
| Redis + ES7 | [config-redis.properties](docker/server/config/config-redis.properties) |
| Postgres | [config-postgres.properties](docker/server/config/config-postgres.properties) |
| Postgres + ES7 | [config-postgres-es7.properties](docker/server/config/config-postgres-es7.properties) |
| MySQL + ES7 | [config-mysql.properties](docker/server/config/config-mysql.properties) |

## Getting Started - Building & Running Conductor
## Other Requirements
* JDK 17+
* UI requires Node 14 to build. Earlier Node versions may work but are untested.

### From Source:
### Building From Source
If you wish to build your own distribution, you can run ```./gradlew build``` from this project that products the runtime artifacts.
The runnable server is in server/ module.

### Using Docker (Recommended)
Follow the steps below to launch the docker container:

```shell

# Create volumes for persistent stores
# Used to create a persistent volume that will preserve the
docker volume create postgres
docker volume create redis
## Conductor OSS Roadmap
[See the roadmap for the Conductor](ROADMAP.md)

docker run --init -p 8080:8080 -p 1234:5000 --mount source=redis,target=/redis \
--mount source=postgres,target=/pgdata conductoross/conductor-standalone:3.15.0
```

Navigate to http://localhost:1234 once the container starts to launch UI.
## Resources
#### [Slack Community](https://join.slack.com/t/orkes-conductor/shared_invite/zt-2hmxn0i3n-_W~a9rWMbvMoYmlJo3Y15g)
We have an active [community](https://join.slack.com/t/orkes-conductor/shared_invite/zt-2hmxn0i3n-_W~a9rWMbvMoYmlJo3Y15g) of Conductor users and contributors on the channel.
#### [Documentation Site](https://docs.conductor-oss.org/)
[Documentation](https://docs.conductor-oss.org/) and tutorial on how to use Conductor

## Docker Containers for production usage
```shell
docker pull conductoross/conductor:3.15.0
```
[Discussion Forum](https://github.com/conductor-oss/conductor/discussions): Please use the forum for questions and discussing ideas and join the community.

### Conductor SDKs
Conductor supports creating workflows using JSON and Code.
SDK support for creating workflows using code is available in multiple languages and can be found at https://github.com/conductor-sdk

## Database Requirements

* The default persistence used is Redis
* The indexing backend is [Elasticsearch](https://www.elastic.co/) (6.x)

## Other Requirements
* JDK 17+
* UI requires Node 14 to build. Earlier Node versions may work but are untested.

## Get Support
There are several ways to get in touch with us:
Expand Down
75 changes: 75 additions & 0 deletions ROADMAP.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# Conductor OSS Roadmap


## New Features
### Type safety for workflow inputs and task input/output through JSON Schema

* Allow type safe workflows and workers with support for JSON schema and protobuf
* Enable scaffolding code generation for workers through schema for workers using CLI tool

### New System Tasks

* Database task to work with relational & no-sql databases
* Polling support for HTTP task
* Operators
* * For..Each with parallel and sequential execution
* * Improved While loop
* * Try..Catch for improved error handling at the task level

### LLM Integrations
Conductor is a perfect platform to build your next LLM powered application or incorporating genAI into your applications.
Enable system tasks for LLM integrations that lets you work with various language models for:
1. Text completion
2. Chat completion with memory
3. Embedding generation

### CLI for Conductor
Allow developers to manage their conductor instance via CLI.

* Manage metadata
* Query and manage workflow executions (terminate, pause, resume, retry)
* Start | Stop manage conductor server

### Support Python as a scripting language for INLINE task
Extend usability of Conductor by allowing lightweight python code as INLINE tasks.

### New APIs for workflow state management

* Synchronous execution of workflows
* update workflow variables
* Update tasks synchronously

## SDKs

* Rust
* Kotlin
* C++
* Ruby
* Swift
* Flutter / Dart
* PHP

### Worker metrics on server
Expose an endpoint on the server that can be used by workers to publish worker specific metrics.
This will allow monitoring metrics for all the workers in a distributed system across the entire system.

## Testing
Infrastructure to make workflows easier to test and debug right from the UI and IDE.

### Workflow Debugger

* Ability to debug your workflows during development just like you would do when you write code
* All functionality of a debugger
* Breakpoints add/remove
* Step to next
* Drop to a certain task that was already executed. (going back in time)
* Ability to inspect, modify, add input / output parameters
* Watch Windows to see values of interesting &nbsp;parameters during execution
* Attaching to a certain WF execution
* Remote Task debugging (with SDK Support).. Enable step by step execution in a task worker from the server

## Maintenance

1. Deprecate support for Elasticsearch 6
2. Update support for newer versions of Elasticsearch
2. Improve/Fix JOIN task performance (less about making it performant and more about just fixing the usability) &nbsp;- Done
3 changes: 0 additions & 3 deletions amqp/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,4 @@ dependencies {

compileOnly 'org.springframework.boot:spring-boot-starter'
compileOnly 'org.springframework.boot:spring-boot-starter-web'



}
5 changes: 4 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ plugins {
id 'maven-publish'
id 'signing'
id 'java-library'
id "com.diffplug.spotless" version "5.0.0"
id "com.diffplug.spotless" version "6.25.0"
id 'jacoco'
id 'org.sonarqube' version '3.4.0.2513'
}
Expand Down Expand Up @@ -355,6 +355,8 @@ allprojects {
strictly '[4.1.108.Final]'
}
}
compileOnly 'org.projectlombok:lombok:1.18.34'
annotationProcessor 'org.projectlombok:lombok:1.18.34'
annotationProcessor 'org.springframework.boot:spring-boot-configuration-processor'

testImplementation('org.springframework.boot:spring-boot-starter-test') {
Expand All @@ -363,6 +365,7 @@ allprojects {
testImplementation('org.springframework.boot:spring-boot-starter-log4j2')
testImplementation 'junit:junit'
testImplementation "org.junit.vintage:junit-vintage-engine"
testAnnotationProcessor 'org.projectlombok:lombok:1.18.34'
}

// processes additional configuration metadata json file as described here
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -403,44 +403,6 @@ class CassandraExecutionDAOSpec extends CassandraSpec {
eventExecutionList != null && eventExecutionList.empty
}

def "verify workflow serialization"() {
given: 'define a workflow'
String workflowId = new IDGenerator().generate()
WorkflowTask workflowTask = new WorkflowTask(taskDefinition: new TaskDef(concurrentExecLimit: 2))
WorkflowDef workflowDef = new WorkflowDef(name: UUID.randomUUID().toString(), version: 1, tasks: [workflowTask])
WorkflowModel workflow = new WorkflowModel(workflowDefinition: workflowDef, workflowId: workflowId, status: WorkflowModel.Status.RUNNING, createTime: System.currentTimeMillis())

when: 'serialize workflow'
def workflowJson = objectMapper.writeValueAsString(workflow)

then:
!workflowJson.contains('failedReferenceTaskNames')
// workflowTask
!workflowJson.contains('decisionCases')
!workflowJson.contains('defaultCase')
!workflowJson.contains('forkTasks')
!workflowJson.contains('joinOn')
!workflowJson.contains('defaultExclusiveJoinTask')
!workflowJson.contains('loopOver')
}

def "verify task serialization"() {
given: 'define a workflow and tasks for this workflow'
String workflowId = new IDGenerator().generate()
WorkflowTask workflowTask = new WorkflowTask(taskDefinition: new TaskDef(concurrentExecLimit: 2))
TaskModel task = new TaskModel(workflowInstanceId: workflowId, taskType: UUID.randomUUID().toString(), referenceTaskName: UUID.randomUUID().toString(), status: TaskModel.Status.SCHEDULED, taskId: new IDGenerator().generate(), workflowTask: workflowTask)

when: 'serialize task'
def taskJson = objectMapper.writeValueAsString(task)

then:
!taskJson.contains('decisionCases')
!taskJson.contains('defaultCase')
!taskJson.contains('forkTasks')
!taskJson.contains('joinOn')
!taskJson.contains('defaultExclusiveJoinTask')
}

def "serde of workflow with large number of tasks"() {
given: 'create a workflow and tasks for this workflow'
String workflowId = new IDGenerator().generate()
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*
* Copyright 2022 Conductor Authors.
* <p>
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*/
package com.netflix.conductor.annotations.protogen;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
* ProtoEnum annotates an enum type that will be exposed via the GRPC API as a native Protocol
* Buffers enum.
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
public @interface ProtoEnum {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
* Copyright 2022 Conductor Authors.
* <p>
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*/
package com.netflix.conductor.annotations.protogen;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
* ProtoField annotates a field inside an struct with metadata on how to expose it on its
* corresponding Protocol Buffers struct. For a field to be exposed in a ProtoBuf struct, the
* containing struct must also be annotated with a {@link ProtoMessage} or {@link ProtoEnum} tag.
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.FIELD)
public @interface ProtoField {
/**
* Mandatory. Sets the Protocol Buffer ID for this specific field. Once a field has been
* annotated with a given ID, the ID can never change to a different value or the resulting
* Protocol Buffer struct will not be backwards compatible.
*
* @return the numeric ID for the field
*/
int id();
}
Loading

0 comments on commit 6aada8b

Please sign in to comment.