Skip to content

Kafka Connect plugin to extend code generated by xjc to produce Kafka Connect Schemas and Structs.

Notifications You must be signed in to change notification settings

jcustenborder/xjc-kafka-connect-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Introduction

xjc-kafka-connect-plugin is used to extend code generated by xjc. All type classes generated by xjc will be augmented to implement the Connectable interface. The following method is added to each of the classes that are generated by xjc. This will return a Struct that is populated with the graph of the object.

    @Override
    public Struct toConnectStruct() {
        Struct struct = new Struct(CONNECT_SCHEMA);
        struct.put("author", this.getAuthor());
        struct.put("title", this.getTitle());
        struct.put("genre", this.getGenre());
        struct.put("price", this.getPrice());
        if (null!= this.getPubDate()) {
            struct.put("pub_date", this.getPubDate().toGregorianCalendar(TimeZone.getTimeZone("UTC"), null, null).getTime());
        } else {
            struct.put("pub_date", null);
        }
        struct.put("review", this.getReview());
        struct.put("id", this.getId());
        return struct;
    }

About

Kafka Connect plugin to extend code generated by xjc to produce Kafka Connect Schemas and Structs.

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages