how to write Junit for spring scs initialized Ktable Store - apache-kafka-streams

I am not able to access store using TopologyTestDriver if I materialized Store with spring scs properties
spring.cloud.stream.kafka.streams.bindings.process-in-1.consumer.materializedAs: incoming-store
how to query store in junit using kafka-utils-test for scs initialized store?

Related

Can a single Spring boot/Spring data application have repo of Posgres and MongoDB

I am having a need where in a same spring boot application I need to use repo of Spring Data Mongo and Spring data jpa (postgres), during my initial testing I got runtime errors. While I debug more just wanted to check in same Spring Data Application can it have both repos for Postgres and MongoDB ?
Yes, you can have, make sure to add all dependency and create separate repositories for each data connection. I used MongoDB and MySql database it is working fine.

Passing a list of values (Oracle UserDefinedType) to Oracle stored procedure using Spring Boot JPA

I am searching for a solution for Passing a list of values (Array or List) to an Oracle Stored Procedure using Spring Boot JPA mechanism.
Here we actually have an Oracle User Defined Type (UDT) which we have to pass via the Spring JPA mechanism. The link Oracle database object type import in Java is quite old and at that time JPA wasn't supporting Oracle UserDefinedTypes.
I got many examples using the simpler JDBC mechanism, but I could not find much regarding JPA.
How to pass in array when calling stored procedure with Spring Data JPA
Please anyone let me know if JPA (Spring JPA / Spring Boot JPA) supports this now.

Create DB tables programmatically using Spring or Hibernate

I'm using Spring Boot 2 and Spring Data JPA using Hibernate 5.2. Spring or Hibernate (not sure, which one does it) can create DB tables automatically by setting spring.jpa.hibernate.ddl-auto = create. This automatically uses the connections settings from spring and the #Entity annotated classes to generate a schema for the DB platform I'm using and creates it.
I want to do the same but in code. I want to add a method that automatically uses existing classes and settings to generate the schema SQL and creates the tables. How to do that?
I tried StandardServiceRegistryBuilder and MetadataSources but I have to configure it manually. I assume there should be a way like Spring is doing it by itself.

Get Entity Metadata in Spring boot and spring data jpa

I need to get entity Metadata like Id, column name, its length, null able etc. I am new to. Spring boot and we are using spring data jpa. Are there anu utility methods that can retrieve me list of columns and its Metadata information for the table in spring boot?
Please help me on this
Thanks in advance
You can use Java Reflection API to get all fields and read metadata information.

Spring Data Repository Populator from CSV

Would Spring Data Repository populator be able to pre load the databases using CSV data or what would be the best way to load CSV data in Spring Boot JPA repositories.
I'd use a CommandLineRunner (assuming you're using Spring Boot)
I've put together a small gist here:
https://gist.github.com/jkupcho/a423bd26509adb08844642ad16e16115

Resources