Question
Apache nifi listen to multicast messages without separator characters
Trying to demonstrate that nifi can listen to multicast traffic.
I have this python script:
import socket
import struct
import sys
# Multicast group details
multicast_group = '224.1.1.1'
server_address = ('', 10000)
# Create a UDP socket
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
# Set the time-to-live for multicast packets
ttl = struct.pack('b', 1)
sock.setsockopt(socket.IPPROTO_IP, socket.IP_MULTICAST_TTL, ttl)
try:
# Send data to the multicast group
message = b'Hello, multicast!'
print(f"sending {message} to {multicast_group}:{server_address[1]}")
sent = sock.sendto(message, (multicast_group, server_address[1]))
except Exception as e:
print(f"Error occurred: {e}")
finally:
sock.close()
And then my listenudp processor is:

How do I get it to receive it with 224.1.1.1.
And then my listenudp processor is:

I can receive the message if I change the multicast_group to 127.0.0.1.
How do I get it to receive it with 224.1.1.1.
I also added this to my nifi properties
# Site to Site properties
nifi.remote.input.host=224.1.1.1
nifi.remote.input.secure=true
nifi.remote.input.socket.port=10000
# Site to Site properties
nifi.remote.input.host=224.1.1.1
nifi.remote.input.secure=true
nifi.remote.input.socket.port=10000

