Nifi - Unable to find schema in LookupRecord - apache-nifi

In Apache NiFi, unable to configure databse schema. I'm trying to find a record in PostgesSQL using LookupRecord. But unable to specify the schema name as there is no such option. It's looking by default in public schema. Please help me with this.

You can specify the particular schema as part of the JDBC URL in newer versions of the Postgres driver. See example here.

Related

Using Apache NiFi's ConfluentSchemaRegistry with Apicurio Schema Registry

I want to use Apache NiFi for writing some data encoded in Avro to Apache Kafka.
Therefore i use the ConvertRecord processor for converting from JSON to Avro. For Avro the AvroRecordSetWriter with ConfluentSchemaRegistry is used. The schema url is set to http:<hostname>:<port>/apis/ccompat/v6 (hostname/port are not important for this question). For having a free alternative to Confluent Schema Registry i deployed a Apicurio Schema Registry. The ccompat API should be compatible to Confluent.
But when i run the NiFi pipeline i get the following error, that the schema with the given name is not found:
Could not retrieve schema with the given name [...] from the configured Schema Registry
But i definitely created the Avro schema with this name in the Web-UI of Apicurio Registry.
Can someone please help me? Is there anybody who is using NiFi for Avro encoding in Kafka by using Apicurio Schema Registry?
Update:
Here are some screenshots of my pipeline and its configuration.
Set schema name via UpdateAttribute
Use ConvertRecord with JsonTreeReader
and ConfluentSchemaRegistry
and AvroSetWriter
Update 2:
This artifact id has to be set:

How can I specify the current schema on quarkus datasource?

Hi I am trying to configure the quarkus to connect to a oracle database. With the current configuration I am able to connect to the database, but I cannot specify the current schema.
I followed the documentation and try to use the new-connection-sql to set the current schema. But it doesn't seems to work.
quarkus.datasource.mydatasource.new-connection-sql=ALTER SESSION SET CURRENT_SCHEMA=SCHEMA_NAME
Here is my application.properties file
quarkus.datasource.mydatasource.db-kind=oracle
quarkus.datasource.mydatasource.jdbc.driver=oracle.jdbc.driver.OracleDriver
quarkus.datasource.mydatasource.jdbc.url=jdbc:oracle:thin:#(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=10.15.73.140)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=SN)))
quarkus.datasource.mydatasource.jdbc.min-size=3
quarkus.datasource.mydatasource.jdbc.max-size=20
quarkus.datasource.mydatasource.username=username
quarkus.datasource.mydatasource.password=password
quarkus.datasource.mydatasource.new-connection-sql=ALTER SESSION SET CURRENT_SCHEMA=SCHEMA_NAME
What could be the issue here?
Thank you.
This is working fine if you add the jdbc sub path name to the property
quarkus.datasource.mydatasource.jdbc.new-connection-sql=ALTER SESSION SET CURRENT_SCHEMA=SCHEMA_NAME
You can refer to these Quarkus configuration references:
https://quarkus.io/guides/datasource#quarkus-agroal_quarkus.datasource.-datasource-name-.jdbc.new-connection-sql
https://quarkus.io/guides/datasource#quarkus-agroal_quarkus.datasource.jdbc.new-connection-sql
You could try to set the schema in the connection url. But what you are trying to archieve, basically routing each user request to a specific schema, you should check the hibernate multitenancy support by this means, you can route each request to the database you want, but beware of the limitations regarding the parameters you can work with to know where to route your request.
Also check hibernate catalog and schema configuration parameters

Can anyone explain detailed use of persistent.xml file in hibernate JPA project?

I have read articles about hibernate -JPA on the internet but unable to understand how it used and how it is working in the background for hibernate. Also, need information about what should be the name of a persistent unit in persistent.xml and what is the use of it?
Mainly we use persistnce.xml / hibernate.cfg.xml to tell hibernate the following details
What Database you're using? so, that hibernate executes all the queries w.r.t that Database
Connecting to Database like Providing Username and password
The database name
Hibernate mapping files name and many more
Go through this link

Mongo Atlast URI Support In Clickhouse

I have been working on connecting clickhouse with mongo atlas and i found nothing in documentation, so i dig into the code and found that MongoDictionarySource.cpp in dbms folder there is no configuration for uri.
On more investigating i came to know that clickhouse is using poco c++ project for database connectivity. In clickhouse submoduled poco's Connection.cpp there is no constructor with uri support but when i go to https://github.com/pocoproject/poco/blob/develop/MongoDB/src/Connection.cpp , i found that Connection.cpp has constructor that support uri.
Is this updated poco version can be submoduled with clickhouse so that i can make dictionary in clickhouse with mongo atlas?
OR
Is there any release comming where it can be already provided?
This feature is further discussed over here: https://github.com/yandex/ClickHouse/pull/5384

jdbc data independence without using hibernate api?

I am trying to solve problem by using properties file but in properties file we can handle only database driver problem.if we want to mysql to oracle database need to change all my query.the problem is now how to make query independent without hibernate api?? please suggest

Resources