Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

https://github.com/onap/policy-models/blob/master/models-pdp/src/main/java/org/onap/policy/models/pdp/concepts/PdpStatus.java

CPS Proposition

CPS is using JSON Schema to specify CPS events.

For event driven architectures it is important to have a schema representing and defining the structure and the format of the data that has to be exchanged by any micro service that need to participate in the conversation. This schema is the contract that producers and consumers agrees on. It has to be carefully versioned and keeping track of potential breaking changes is important. Without such an explicit contract, the contract becomes implicit, fragile and integrating the services could be more challenging. Different options to define the event data structure and format could be JSON Schema, Apache Avro or Google Protocol Buffers. It has been chosen to start with JSON Schema that is still simple and straightforward to implement. (see CPS-191: Core and Temporal Integration Design#DataUpdatedEventSchema for additional details)

...

Code Block
languagexml
titlepom.xml
collapsetrue
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xmlns="http://maven.apache.org/POM/4.0.0"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>org.onap.cps</groupId>
        <artifactId>cps-parent</artifactId>
        <version>1.1.0-SNAPSHOT</version>
        <relativePath>../cps-parent/pom.xml</relativePath>
    </parent>

    <artifactId>cps-events</artifactId>
    <packaging>jar</packaging>

    <properties>
        <maven.install.skip>false</maven.install.skip>
        <maven.deploy.skip>false</maven.deploy.skip>
    </properties>

    <dependencies>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-databind</artifactId>
            <version>2.5.4</version>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.jsonschema2pojo</groupId>
                <artifactId>jsonschema2pojo-maven-plugin</artifactId>
                <version>1.1.1</version>
                <configuration>
                    <sourceDirectory>${basedir}/src/main/resources/schemas</sourceDirectory>
                    <targetPackage>org.onap.cps.event.schema</targetPackage>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>generate</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

</project>

...