mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
Move useSchemaRegistry out of the options to be easier to see the extra fields
This commit is contained in:
@@ -58,6 +58,28 @@ export class KafkaTrigger implements INodeType {
|
||||
placeholder: 'n8n-kafka',
|
||||
description: 'ID of the consumer group.',
|
||||
},
|
||||
{
|
||||
displayName: 'Use Schema Registry',
|
||||
name: 'useSchemaRegistry',
|
||||
type: 'boolean',
|
||||
default: false,
|
||||
description: 'Use Apache Avro serialization format and Confluent\' wire formats.',
|
||||
},
|
||||
{
|
||||
displayName: 'Schema Registry URL',
|
||||
name: 'schemaRegistryUrl',
|
||||
type: 'string',
|
||||
required: true,
|
||||
displayOptions: {
|
||||
show: {
|
||||
useSchemaRegistry: [
|
||||
true,
|
||||
],
|
||||
},
|
||||
},
|
||||
default: '',
|
||||
description: 'URL of the schema registry.',
|
||||
},
|
||||
{
|
||||
displayName: 'Options',
|
||||
name: 'options',
|
||||
@@ -100,27 +122,6 @@ export class KafkaTrigger implements INodeType {
|
||||
default: 30000,
|
||||
description: 'The time to await a response in ms.',
|
||||
},
|
||||
{
|
||||
displayName: 'Use Schema Registry',
|
||||
name: 'useSchemaRegistry',
|
||||
type: 'boolean',
|
||||
default: false,
|
||||
description: 'Use Apache Avro serialization format and Confluent\' wire formats.',
|
||||
},
|
||||
{
|
||||
displayName: 'Schema Registry URL',
|
||||
name: 'schemaRegistryUrl',
|
||||
type: 'string',
|
||||
displayOptions: {
|
||||
show: {
|
||||
useSchemaRegistry: [
|
||||
true,
|
||||
],
|
||||
},
|
||||
},
|
||||
default: '',
|
||||
description: 'URL of the schema registry.',
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
@@ -170,9 +171,13 @@ export class KafkaTrigger implements INodeType {
|
||||
|
||||
const options = this.getNodeParameter('options', {}) as IDataObject;
|
||||
|
||||
const useSchemaRegistry = this.getNodeParameter('useSchemaRegistry', 0) as boolean;
|
||||
|
||||
const schemaRegistryUrl = this.getNodeParameter('schemaRegistryUrl', 0) as string;
|
||||
|
||||
let registry: SchemaRegistry;
|
||||
if (options.useSchemaRegistry) {
|
||||
registry = new SchemaRegistry({ host: options.schemaRegistryUrl as string });
|
||||
if (useSchemaRegistry) {
|
||||
registry = new SchemaRegistry({ host: schemaRegistryUrl });
|
||||
}
|
||||
|
||||
const startConsumer = async () => {
|
||||
|
||||
Reference in New Issue
Block a user