diff --git a/Dockerfile b/Dockerfile
index 6595eda..3482c47 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -43,6 +43,8 @@
 
 FROM alpine:3.9.4
 WORKDIR /app/
+COPY https-server.crt .
+COPY https-server.key .
 COPY --from=build-env /app/main .
 ENTRYPOINT ["./main"]
 
diff --git a/data_collector.go b/data_collector.go
index b5b4d49..f68f280 100644
--- a/data_collector.go
+++ b/data_collector.go
@@ -23,10 +23,12 @@
 	"io/ioutil"
 )
 
-func get_status(ip string, service string) (rtn bool, data []string) {
+func (s *Server) get_status(ip string, service string) (rtn bool, data []string) {
 	rtn = false
 
-	uri := ip + REDFISH_ROOT + service
+//	uri := "https://"+ip + REDFISH_ROOT + service
+	uri := s.devicemap[ip].protocol+"://"+ip + REDFISH_ROOT + service
+        fmt.Printf("%q", uri)
 	resp, err := http.Get(uri)
 	if err != nil {
 		fmt.Println(err)
@@ -42,7 +44,9 @@
 		matches := re.FindAllString(memberstr, -1)
 		for _, match := range matches {
 			m := strings.Trim(match, "[]")
-			uri = ip + strings.TrimPrefix(m, "@odata.id:")
+			uri = s.devicemap[ip].protocol +"://"+ip + strings.TrimPrefix(m, "@odata.id:")
+			fmt.Println("Printing URI")
+			fmt.Println(uri)
 			resp, err = http.Get(uri)
 		        if err != nil {
 			        fmt.Println(err)
diff --git a/demo_test/Makefile b/demo_test/Makefile
new file mode 100644
index 0000000..d2d3ced
--- /dev/null
+++ b/demo_test/Makefile
@@ -0,0 +1,30 @@
+# Copyright 2018-present Open Networking Foundation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+prereq:
+	go get -v google.golang.org/grpc
+	go get -v github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway
+	go get -v github.com/golang/protobuf/protoc-gen-go
+	go get github.com/Sirupsen/logrus
+	go get github.com/Shopify/sarama
+
+demotest: prereq proto/importer.pb.go
+	go build -i -v -o $@
+
+
+proto/importer.pb.go: ../proto/importer.proto
+	protoc --proto_path=../proto \
+	-I${GOPATH}/src/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis \
+	--go_out=plugins=grpc:proto/ \
+	../proto/importer.proto
diff --git a/demo_test/demotest b/demo_test/demotest
new file mode 100755
index 0000000..ed7c50b
--- /dev/null
+++ b/demo_test/demotest
Binary files differ
diff --git a/demo_test/kafka_ip.sh b/demo_test/kafka_ip.sh
new file mode 100755
index 0000000..433ab38
--- /dev/null
+++ b/demo_test/kafka_ip.sh
@@ -0,0 +1,15 @@
+#!/bin/sh
+# Copyright 2018 Open Networking Foundation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+#  distributed under the License is distributed on an "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#  See the License for the specific language governing permissions and
+#  limitations under the License.
+kubectl exec cord-kafka-0 -- ip a | grep -oE "([0-9]{1,3}\\.){3}[0-9]{1,3}\\b" | grep 192
diff --git a/demo_test/proto/importer.pb.go b/demo_test/proto/importer.pb.go
new file mode 100644
index 0000000..0e2fe6a
--- /dev/null
+++ b/demo_test/proto/importer.pb.go
@@ -0,0 +1,432 @@
+// Code generated by protoc-gen-go. DO NOT EDIT.
+// source: importer.proto
+
+package importer
+
+import (
+	context "context"
+	fmt "fmt"
+	proto "github.com/golang/protobuf/proto"
+	empty "github.com/golang/protobuf/ptypes/empty"
+	grpc "google.golang.org/grpc"
+	codes "google.golang.org/grpc/codes"
+	status "google.golang.org/grpc/status"
+	math "math"
+)
+
+// Reference imports to suppress errors if they are not otherwise used.
+var _ = proto.Marshal
+var _ = fmt.Errorf
+var _ = math.Inf
+
+// This is a compile-time assertion to ensure that this generated file
+// is compatible with the proto package it is being compiled against.
+// A compilation error at this line likely means your copy of the
+// proto package needs to be updated.
+const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
+
+type DeviceInfo struct {
+	IpAddress            string   `protobuf:"bytes,1,opt,name=ip_address,json=ipAddress,proto3" json:"ip_address,omitempty"`
+	Frequency            uint32   `protobuf:"varint,2,opt,name=frequency,proto3" json:"frequency,omitempty"`
+	Vendor               string   `protobuf:"bytes,3,opt,name=vendor,proto3" json:"vendor,omitempty"`
+	Protocol             string   `protobuf:"bytes,4,opt,name=protocol,proto3" json:"protocol,omitempty"`
+	XXX_NoUnkeyedLiteral struct{} `json:"-"`
+	XXX_unrecognized     []byte   `json:"-"`
+	XXX_sizecache        int32    `json:"-"`
+}
+
+func (m *DeviceInfo) Reset()         { *m = DeviceInfo{} }
+func (m *DeviceInfo) String() string { return proto.CompactTextString(m) }
+func (*DeviceInfo) ProtoMessage()    {}
+func (*DeviceInfo) Descriptor() ([]byte, []int) {
+	return fileDescriptor_394990ff89e0d02b, []int{0}
+}
+
+func (m *DeviceInfo) XXX_Unmarshal(b []byte) error {
+	return xxx_messageInfo_DeviceInfo.Unmarshal(m, b)
+}
+func (m *DeviceInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+	return xxx_messageInfo_DeviceInfo.Marshal(b, m, deterministic)
+}
+func (m *DeviceInfo) XXX_Merge(src proto.Message) {
+	xxx_messageInfo_DeviceInfo.Merge(m, src)
+}
+func (m *DeviceInfo) XXX_Size() int {
+	return xxx_messageInfo_DeviceInfo.Size(m)
+}
+func (m *DeviceInfo) XXX_DiscardUnknown() {
+	xxx_messageInfo_DeviceInfo.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_DeviceInfo proto.InternalMessageInfo
+
+func (m *DeviceInfo) GetIpAddress() string {
+	if m != nil {
+		return m.IpAddress
+	}
+	return ""
+}
+
+func (m *DeviceInfo) GetFrequency() uint32 {
+	if m != nil {
+		return m.Frequency
+	}
+	return 0
+}
+
+func (m *DeviceInfo) GetVendor() string {
+	if m != nil {
+		return m.Vendor
+	}
+	return ""
+}
+
+func (m *DeviceInfo) GetProtocol() string {
+	if m != nil {
+		return m.Protocol
+	}
+	return ""
+}
+
+type EventList struct {
+	EventIpAddress       string   `protobuf:"bytes,1,opt,name=event_ip_address,json=eventIpAddress,proto3" json:"event_ip_address,omitempty"`
+	Events               []string `protobuf:"bytes,2,rep,name=events,proto3" json:"events,omitempty"`
+	XXX_NoUnkeyedLiteral struct{} `json:"-"`
+	XXX_unrecognized     []byte   `json:"-"`
+	XXX_sizecache        int32    `json:"-"`
+}
+
+func (m *EventList) Reset()         { *m = EventList{} }
+func (m *EventList) String() string { return proto.CompactTextString(m) }
+func (*EventList) ProtoMessage()    {}
+func (*EventList) Descriptor() ([]byte, []int) {
+	return fileDescriptor_394990ff89e0d02b, []int{1}
+}
+
+func (m *EventList) XXX_Unmarshal(b []byte) error {
+	return xxx_messageInfo_EventList.Unmarshal(m, b)
+}
+func (m *EventList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+	return xxx_messageInfo_EventList.Marshal(b, m, deterministic)
+}
+func (m *EventList) XXX_Merge(src proto.Message) {
+	xxx_messageInfo_EventList.Merge(m, src)
+}
+func (m *EventList) XXX_Size() int {
+	return xxx_messageInfo_EventList.Size(m)
+}
+func (m *EventList) XXX_DiscardUnknown() {
+	xxx_messageInfo_EventList.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_EventList proto.InternalMessageInfo
+
+func (m *EventList) GetEventIpAddress() string {
+	if m != nil {
+		return m.EventIpAddress
+	}
+	return ""
+}
+
+func (m *EventList) GetEvents() []string {
+	if m != nil {
+		return m.Events
+	}
+	return nil
+}
+
+type SupportedEventList struct {
+	Events               []string `protobuf:"bytes,1,rep,name=events,proto3" json:"events,omitempty"`
+	XXX_NoUnkeyedLiteral struct{} `json:"-"`
+	XXX_unrecognized     []byte   `json:"-"`
+	XXX_sizecache        int32    `json:"-"`
+}
+
+func (m *SupportedEventList) Reset()         { *m = SupportedEventList{} }
+func (m *SupportedEventList) String() string { return proto.CompactTextString(m) }
+func (*SupportedEventList) ProtoMessage()    {}
+func (*SupportedEventList) Descriptor() ([]byte, []int) {
+	return fileDescriptor_394990ff89e0d02b, []int{2}
+}
+
+func (m *SupportedEventList) XXX_Unmarshal(b []byte) error {
+	return xxx_messageInfo_SupportedEventList.Unmarshal(m, b)
+}
+func (m *SupportedEventList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
+	return xxx_messageInfo_SupportedEventList.Marshal(b, m, deterministic)
+}
+func (m *SupportedEventList) XXX_Merge(src proto.Message) {
+	xxx_messageInfo_SupportedEventList.Merge(m, src)
+}
+func (m *SupportedEventList) XXX_Size() int {
+	return xxx_messageInfo_SupportedEventList.Size(m)
+}
+func (m *SupportedEventList) XXX_DiscardUnknown() {
+	xxx_messageInfo_SupportedEventList.DiscardUnknown(m)
+}
+
+var xxx_messageInfo_SupportedEventList proto.InternalMessageInfo
+
+func (m *SupportedEventList) GetEvents() []string {
+	if m != nil {
+		return m.Events
+	}
+	return nil
+}
+
+func init() {
+	proto.RegisterType((*DeviceInfo)(nil), "importer.DeviceInfo")
+	proto.RegisterType((*EventList)(nil), "importer.EventList")
+	proto.RegisterType((*SupportedEventList)(nil), "importer.SupportedEventList")
+}
+
+func init() { proto.RegisterFile("importer.proto", fileDescriptor_394990ff89e0d02b) }
+
+var fileDescriptor_394990ff89e0d02b = []byte{
+	// 329 bytes of a gzipped FileDescriptorProto
+	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x90, 0xcf, 0x4a, 0xf3, 0x40,
+	0x14, 0xc5, 0x9b, 0xf6, 0xa3, 0x34, 0x97, 0x7e, 0x45, 0x47, 0xad, 0xa1, 0x56, 0x28, 0x59, 0x75,
+	0x21, 0x29, 0xe8, 0x5e, 0x14, 0xfa, 0xc7, 0x82, 0x6e, 0x1a, 0x5c, 0x97, 0x26, 0xb9, 0x2d, 0x03,
+	0xcd, 0xcc, 0x38, 0x33, 0x09, 0x74, 0xe1, 0x23, 0xfb, 0x0e, 0x92, 0x89, 0xcd, 0x14, 0x2a, 0x82,
+	0xe0, 0xf2, 0xfc, 0xe6, 0x9e, 0xb9, 0xe7, 0x1e, 0xe8, 0xd0, 0x54, 0x70, 0xa9, 0x51, 0x06, 0x42,
+	0x72, 0xcd, 0x49, 0x6b, 0xaf, 0x7b, 0x57, 0x1b, 0xce, 0x37, 0x5b, 0x1c, 0x19, 0x1e, 0x65, 0xeb,
+	0x11, 0xa6, 0x42, 0xef, 0xca, 0x31, 0xff, 0x1d, 0x60, 0x8c, 0x39, 0x8d, 0x71, 0xce, 0xd6, 0x9c,
+	0x5c, 0x03, 0x50, 0xb1, 0x5c, 0x25, 0x89, 0x44, 0xa5, 0x3c, 0x67, 0xe0, 0x0c, 0xdd, 0x85, 0x4b,
+	0xc5, 0x63, 0x09, 0x48, 0x1f, 0xdc, 0xb5, 0xc4, 0xb7, 0x0c, 0x59, 0xbc, 0xf3, 0xea, 0x03, 0x67,
+	0xf8, 0x7f, 0x61, 0x01, 0xe9, 0x42, 0x33, 0x47, 0x96, 0x70, 0xe9, 0x35, 0x8c, 0xf1, 0x4b, 0x91,
+	0x1e, 0xb4, 0xcc, 0xae, 0x98, 0x6f, 0xbd, 0x7f, 0xe6, 0xa5, 0xd2, 0xfe, 0x0b, 0xb8, 0x93, 0x1c,
+	0x99, 0x7e, 0xa6, 0x4a, 0x93, 0x21, 0x9c, 0x60, 0x21, 0x96, 0x47, 0x19, 0x3a, 0x86, 0xcf, 0xab,
+	0x20, 0x5d, 0x68, 0x1a, 0xa2, 0xbc, 0xfa, 0xa0, 0x51, 0xac, 0x2a, 0x95, 0x7f, 0x03, 0x24, 0xcc,
+	0x84, 0xb9, 0x3b, 0xb1, 0xff, 0xda, 0x69, 0xe7, 0x70, 0xfa, 0xf6, 0xa3, 0x0e, 0xa7, 0x89, 0x39,
+	0x7e, 0x99, 0xae, 0xd8, 0x6a, 0x83, 0x29, 0x32, 0x4d, 0x1e, 0xa0, 0x13, 0x22, 0x4b, 0x0e, 0x5a,
+	0x39, 0x0f, 0xaa, 0x6e, 0x2d, 0xed, 0x75, 0x83, 0xb2, 0xd7, 0x60, 0xdf, 0x6b, 0x30, 0x29, 0x7a,
+	0xf5, 0x6b, 0xe4, 0x1e, 0xda, 0x21, 0xea, 0x69, 0x55, 0xcc, 0x6f, 0xfd, 0x63, 0x68, 0xcf, 0x50,
+	0xdb, 0xfc, 0xdf, 0xfb, 0xfb, 0x96, 0x1e, 0xdf, 0xec, 0xd7, 0xc8, 0x14, 0x2e, 0xc2, 0x2c, 0x52,
+	0x32, 0x96, 0x34, 0xc2, 0x19, 0xcd, 0x91, 0x99, 0x57, 0x45, 0xce, 0xac, 0xb1, 0x9a, 0xff, 0x21,
+	0xcd, 0x13, 0x5c, 0xbe, 0xb2, 0xbf, 0xf8, 0x29, 0x6a, 0x1a, 0x72, 0xf7, 0x19, 0x00, 0x00, 0xff,
+	0xff, 0x79, 0x23, 0x4a, 0xc2, 0xab, 0x02, 0x00, 0x00,
+}
+
+// Reference imports to suppress errors if they are not otherwise used.
+var _ context.Context
+var _ grpc.ClientConn
+
+// This is a compile-time assertion to ensure that this generated file
+// is compatible with the grpc package it is being compiled against.
+const _ = grpc.SupportPackageIsVersion4
+
+// DeviceManagementClient is the client API for DeviceManagement service.
+//
+// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
+type DeviceManagementClient interface {
+	SendDeviceInfo(ctx context.Context, in *DeviceInfo, opts ...grpc.CallOption) (*empty.Empty, error)
+	SetFrequency(ctx context.Context, in *DeviceInfo, opts ...grpc.CallOption) (*empty.Empty, error)
+	GetEventList(ctx context.Context, in *DeviceInfo, opts ...grpc.CallOption) (*SupportedEventList, error)
+	SubsrcribeGivenEvents(ctx context.Context, in *EventList, opts ...grpc.CallOption) (*empty.Empty, error)
+	UnSubsrcribeGivenEvents(ctx context.Context, in *EventList, opts ...grpc.CallOption) (*empty.Empty, error)
+}
+
+type deviceManagementClient struct {
+	cc *grpc.ClientConn
+}
+
+func NewDeviceManagementClient(cc *grpc.ClientConn) DeviceManagementClient {
+	return &deviceManagementClient{cc}
+}
+
+func (c *deviceManagementClient) SendDeviceInfo(ctx context.Context, in *DeviceInfo, opts ...grpc.CallOption) (*empty.Empty, error) {
+	out := new(empty.Empty)
+	err := c.cc.Invoke(ctx, "/importer.device_management/SendDeviceInfo", in, out, opts...)
+	if err != nil {
+		return nil, err
+	}
+	return out, nil
+}
+
+func (c *deviceManagementClient) SetFrequency(ctx context.Context, in *DeviceInfo, opts ...grpc.CallOption) (*empty.Empty, error) {
+	out := new(empty.Empty)
+	err := c.cc.Invoke(ctx, "/importer.device_management/SetFrequency", in, out, opts...)
+	if err != nil {
+		return nil, err
+	}
+	return out, nil
+}
+
+func (c *deviceManagementClient) GetEventList(ctx context.Context, in *DeviceInfo, opts ...grpc.CallOption) (*SupportedEventList, error) {
+	out := new(SupportedEventList)
+	err := c.cc.Invoke(ctx, "/importer.device_management/GetEventList", in, out, opts...)
+	if err != nil {
+		return nil, err
+	}
+	return out, nil
+}
+
+func (c *deviceManagementClient) SubsrcribeGivenEvents(ctx context.Context, in *EventList, opts ...grpc.CallOption) (*empty.Empty, error) {
+	out := new(empty.Empty)
+	err := c.cc.Invoke(ctx, "/importer.device_management/SubsrcribeGivenEvents", in, out, opts...)
+	if err != nil {
+		return nil, err
+	}
+	return out, nil
+}
+
+func (c *deviceManagementClient) UnSubsrcribeGivenEvents(ctx context.Context, in *EventList, opts ...grpc.CallOption) (*empty.Empty, error) {
+	out := new(empty.Empty)
+	err := c.cc.Invoke(ctx, "/importer.device_management/UnSubsrcribeGivenEvents", in, out, opts...)
+	if err != nil {
+		return nil, err
+	}
+	return out, nil
+}
+
+// DeviceManagementServer is the server API for DeviceManagement service.
+type DeviceManagementServer interface {
+	SendDeviceInfo(context.Context, *DeviceInfo) (*empty.Empty, error)
+	SetFrequency(context.Context, *DeviceInfo) (*empty.Empty, error)
+	GetEventList(context.Context, *DeviceInfo) (*SupportedEventList, error)
+	SubsrcribeGivenEvents(context.Context, *EventList) (*empty.Empty, error)
+	UnSubsrcribeGivenEvents(context.Context, *EventList) (*empty.Empty, error)
+}
+
+// UnimplementedDeviceManagementServer can be embedded to have forward compatible implementations.
+type UnimplementedDeviceManagementServer struct {
+}
+
+func (*UnimplementedDeviceManagementServer) SendDeviceInfo(ctx context.Context, req *DeviceInfo) (*empty.Empty, error) {
+	return nil, status.Errorf(codes.Unimplemented, "method SendDeviceInfo not implemented")
+}
+func (*UnimplementedDeviceManagementServer) SetFrequency(ctx context.Context, req *DeviceInfo) (*empty.Empty, error) {
+	return nil, status.Errorf(codes.Unimplemented, "method SetFrequency not implemented")
+}
+func (*UnimplementedDeviceManagementServer) GetEventList(ctx context.Context, req *DeviceInfo) (*SupportedEventList, error) {
+	return nil, status.Errorf(codes.Unimplemented, "method GetEventList not implemented")
+}
+func (*UnimplementedDeviceManagementServer) SubsrcribeGivenEvents(ctx context.Context, req *EventList) (*empty.Empty, error) {
+	return nil, status.Errorf(codes.Unimplemented, "method SubsrcribeGivenEvents not implemented")
+}
+func (*UnimplementedDeviceManagementServer) UnSubsrcribeGivenEvents(ctx context.Context, req *EventList) (*empty.Empty, error) {
+	return nil, status.Errorf(codes.Unimplemented, "method UnSubsrcribeGivenEvents not implemented")
+}
+
+func RegisterDeviceManagementServer(s *grpc.Server, srv DeviceManagementServer) {
+	s.RegisterService(&_DeviceManagement_serviceDesc, srv)
+}
+
+func _DeviceManagement_SendDeviceInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+	in := new(DeviceInfo)
+	if err := dec(in); err != nil {
+		return nil, err
+	}
+	if interceptor == nil {
+		return srv.(DeviceManagementServer).SendDeviceInfo(ctx, in)
+	}
+	info := &grpc.UnaryServerInfo{
+		Server:     srv,
+		FullMethod: "/importer.device_management/SendDeviceInfo",
+	}
+	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+		return srv.(DeviceManagementServer).SendDeviceInfo(ctx, req.(*DeviceInfo))
+	}
+	return interceptor(ctx, in, info, handler)
+}
+
+func _DeviceManagement_SetFrequency_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+	in := new(DeviceInfo)
+	if err := dec(in); err != nil {
+		return nil, err
+	}
+	if interceptor == nil {
+		return srv.(DeviceManagementServer).SetFrequency(ctx, in)
+	}
+	info := &grpc.UnaryServerInfo{
+		Server:     srv,
+		FullMethod: "/importer.device_management/SetFrequency",
+	}
+	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+		return srv.(DeviceManagementServer).SetFrequency(ctx, req.(*DeviceInfo))
+	}
+	return interceptor(ctx, in, info, handler)
+}
+
+func _DeviceManagement_GetEventList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+	in := new(DeviceInfo)
+	if err := dec(in); err != nil {
+		return nil, err
+	}
+	if interceptor == nil {
+		return srv.(DeviceManagementServer).GetEventList(ctx, in)
+	}
+	info := &grpc.UnaryServerInfo{
+		Server:     srv,
+		FullMethod: "/importer.device_management/GetEventList",
+	}
+	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+		return srv.(DeviceManagementServer).GetEventList(ctx, req.(*DeviceInfo))
+	}
+	return interceptor(ctx, in, info, handler)
+}
+
+func _DeviceManagement_SubsrcribeGivenEvents_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+	in := new(EventList)
+	if err := dec(in); err != nil {
+		return nil, err
+	}
+	if interceptor == nil {
+		return srv.(DeviceManagementServer).SubsrcribeGivenEvents(ctx, in)
+	}
+	info := &grpc.UnaryServerInfo{
+		Server:     srv,
+		FullMethod: "/importer.device_management/SubsrcribeGivenEvents",
+	}
+	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+		return srv.(DeviceManagementServer).SubsrcribeGivenEvents(ctx, req.(*EventList))
+	}
+	return interceptor(ctx, in, info, handler)
+}
+
+func _DeviceManagement_UnSubsrcribeGivenEvents_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+	in := new(EventList)
+	if err := dec(in); err != nil {
+		return nil, err
+	}
+	if interceptor == nil {
+		return srv.(DeviceManagementServer).UnSubsrcribeGivenEvents(ctx, in)
+	}
+	info := &grpc.UnaryServerInfo{
+		Server:     srv,
+		FullMethod: "/importer.device_management/UnSubsrcribeGivenEvents",
+	}
+	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+		return srv.(DeviceManagementServer).UnSubsrcribeGivenEvents(ctx, req.(*EventList))
+	}
+	return interceptor(ctx, in, info, handler)
+}
+
+var _DeviceManagement_serviceDesc = grpc.ServiceDesc{
+	ServiceName: "importer.device_management",
+	HandlerType: (*DeviceManagementServer)(nil),
+	Methods: []grpc.MethodDesc{
+		{
+			MethodName: "SendDeviceInfo",
+			Handler:    _DeviceManagement_SendDeviceInfo_Handler,
+		},
+		{
+			MethodName: "SetFrequency",
+			Handler:    _DeviceManagement_SetFrequency_Handler,
+		},
+		{
+			MethodName: "GetEventList",
+			Handler:    _DeviceManagement_GetEventList_Handler,
+		},
+		{
+			MethodName: "SubsrcribeGivenEvents",
+			Handler:    _DeviceManagement_SubsrcribeGivenEvents_Handler,
+		},
+		{
+			MethodName: "UnSubsrcribeGivenEvents",
+			Handler:    _DeviceManagement_UnSubsrcribeGivenEvents_Handler,
+		},
+	},
+	Streams:  []grpc.StreamDesc{},
+	Metadata: "importer.proto",
+}
diff --git a/demo_test/test.go b/demo_test/test.go
new file mode 100644
index 0000000..b0502ac
--- /dev/null
+++ b/demo_test/test.go
@@ -0,0 +1,136 @@
+// Copyright 2018 Open Networking Foundation
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package main
+
+import (
+        "fmt"
+        "os"
+        "os/signal"
+        "os/exec"
+        "github.com/Shopify/sarama"
+        "google.golang.org/grpc"
+        "golang.org/x/net/context"
+        importer "./proto"
+        log "github.com/Sirupsen/logrus"
+	"time"
+	"bytes"
+	"strings"
+
+)
+
+const (
+	 address     = "localhost:31085"
+	vendor       = "edgecore"
+//	device_ip    = "192.168.3.44:9888"
+	device_ip    = "192.168.4.27:8888"
+	protocol     = "https"
+	freq         = 180
+)
+var importerTopic = "importer"
+var DataConsumer sarama.Consumer
+
+func init() {
+        Formatter := new(log.TextFormatter)
+        Formatter.TimestampFormat = "02-01-2006 15:04:05"
+        Formatter.FullTimestamp = true
+        log.SetFormatter(Formatter)
+}
+
+func topicListener(topic *string, master sarama.Consumer) {
+	log.Info("Starting topicListener for ", *topic)
+	consumer, err := master.ConsumePartition(*topic, 0, sarama.OffsetOldest)
+	if err != nil {
+		log.Error("topicListener panic, topic=[%s]: %s", *topic, err.Error())
+		os.Exit(1)
+	}
+	signals := make(chan os.Signal, 1)
+	signal.Notify(signals, os.Interrupt)
+	doneCh := make(chan struct{})
+	go func() {
+		for {
+			select {
+			case err := <-consumer.Errors():
+				log.Error("Consumer error: %s", err.Err)
+			case msg := <-consumer.Messages():
+				log.Info("Got message on topic=[%s]: %s", *topic, string(msg.Value))
+			case <-signals:
+				log.Warn("Interrupt is detected")
+				doneCh <- struct{}{}
+			}
+		}
+	}()
+	<-doneCh
+}
+
+func kafkainit() {
+	cmd := exec.Command("/bin/sh","kafka_ip.sh")
+	var kafkaIP string
+	var out bytes.Buffer
+	cmd.Stdout = &out
+	err := cmd.Run()
+	if err != nil {
+		log.Info(err)
+		os.Exit(1)
+	}
+
+	kafkaIP = out.String()
+	kafkaIP = strings.TrimSuffix(kafkaIP, "\n")
+	kafkaIP = kafkaIP +":9092"
+	fmt.Println("IP address of kafka-cord-0:",kafkaIP)
+	config := sarama.NewConfig()
+	config.Consumer.Return.Errors = true
+	master, err := sarama.NewConsumer([]string{kafkaIP}, config)
+	if err != nil {
+		panic(err)
+	}
+	DataConsumer = master
+
+	go topicListener(&importerTopic, master)
+}
+func main() {
+	log.Info("kafkaInit starting")
+	kafkainit()
+	// Set up a connection to the server.
+	fmt.Println("Starting connection")
+	conn, err := grpc.Dial(address, grpc.WithInsecure())
+	if err != nil {
+	        fmt.Println("could not connect")
+		log.Fatal("did not connect: %v", err)
+	}
+	defer conn.Close()
+	c := importer.NewDeviceManagementClient(conn)
+
+	ctx, cancel := context.WithTimeout(context.Background(), time.Minute)
+	defer cancel()
+	deviceinfo := new(importer.DeviceInfo)
+	deviceinfo.IpAddress  = device_ip
+	deviceinfo.Vendor     = vendor
+	deviceinfo.Frequency   = freq
+	deviceinfo.Protocol    = protocol
+	_, err = c.SendDeviceInfo(ctx, deviceinfo)
+	if err != nil {
+		log.Fatal("could not SendDeviceInfo: %v", err)
+	}
+        quit := make(chan os.Signal)
+        signal.Notify(quit, os.Interrupt)
+
+        select {
+        case sig := <-quit:
+                fmt.Println("Shutting down:", sig)
+                DataConsumer.Close()
+                        panic(err)
+        }
+
+}
diff --git a/event_subscriber.go b/event_subscriber.go
index ba7a2e9..b2f0112 100644
--- a/event_subscriber.go
+++ b/event_subscriber.go
@@ -31,7 +31,7 @@
 	rtn = false
 	id = 0
 
-	destip := os.Getenv("DEVICE_MANAGEMENT_DESTIP") + ":" + os.Getenv("DEVICE_MANAGEMENT_DESTPORT")
+	destip := os.Getenv("EVENT_NOTIFICATION_DESTIP") + ":" + os.Getenv("DEVICE_MANAGEMENT_DESTPORT")
 	subscrpt_info := map[string]interface{}{"Context":"TBD","Protocol":"Redfish"}
 	subscrpt_info["Name"] = event + " event subscription"
 	subscrpt_info["Destination"] = "https://" + destip
diff --git a/https-server.crt b/https-server.crt
new file mode 100644
index 0000000..e6cdef1
--- /dev/null
+++ b/https-server.crt
@@ -0,0 +1,15 @@
+-----BEGIN CERTIFICATE-----
+MIICTTCCAdSgAwIBAgIJAI95JJ9uQ7fzMAoGCCqGSM49BAMCMGUxCzAJBgNVBAYT
+AkFVMRMwEQYDVQQIDApTb21lLVN0YXRlMRIwEAYDVQQKDAllZGdlLWNvcmUxLTAr
+BgkqhkiG9w0BCQEWHmRpbmVzaF9iZWx3YWxrYXJAZWRnZS1jb3JlLmNvbTAeFw0x
+OTA4MDIxODIyNDNaFw0yOTA3MzAxODIyNDNaMGUxCzAJBgNVBAYTAkFVMRMwEQYD
+VQQIDApTb21lLVN0YXRlMRIwEAYDVQQKDAllZGdlLWNvcmUxLTArBgkqhkiG9w0B
+CQEWHmRpbmVzaF9iZWx3YWxrYXJAZWRnZS1jb3JlLmNvbTB2MBAGByqGSM49AgEG
+BSuBBAAiA2IABEfiwuwCRJzUEqktyKlFLxjTvXRTlMELJAXWAf8xrNokaKvyrBgQ
+GrrT3ZOzh0eBBdEVQGHMz3NoC6A7Ah0YX3Cj97jByXRsdkd6Fc+sebBsWsLknXaf
+IEXqrr5X6FCL/qNQME4wHQYDVR0OBBYEFDrLvdRrXUgGjUwcgmufH0bAgvOUMB8G
+A1UdIwQYMBaAFDrLvdRrXUgGjUwcgmufH0bAgvOUMAwGA1UdEwQFMAMBAf8wCgYI
+KoZIzj0EAwIDZwAwZAIwLuIZYzChsLb64GTBZ8Dpa+6NFAfbd/RB7s2k8yEASGik
+UXpqe+RFosqhnGqmZz3JAjAxDodCrKaVfcH1BLTLZTZfm1scajT1JvplPKcOgzrn
+kghLMxTd2Sz61YMip8DjqPs=
+-----END CERTIFICATE-----
diff --git a/https-server.key b/https-server.key
new file mode 100644
index 0000000..885cd84
--- /dev/null
+++ b/https-server.key
@@ -0,0 +1,9 @@
+-----BEGIN EC PARAMETERS-----
+BgUrgQQAIg==
+-----END EC PARAMETERS-----
+-----BEGIN EC PRIVATE KEY-----
+MIGkAgEBBDD/m1fZcHwvpGNRq6KjraovQAvmadWhs8jA4HGX6PGMibHydTpJy0g2
+UcXz5UijTjKgBwYFK4EEACKhZANiAARH4sLsAkSc1BKpLcipRS8Y0710U5TBCyQF
+1gH/MazaJGir8qwYEBq6092Ts4dHgQXRFUBhzM9zaAugOwIdGF9wo/e4wcl0bHZH
+ehXPrHmwbFrC5J12nyBF6q6+V+hQi/4=
+-----END EC PRIVATE KEY-----
diff --git a/main.go b/main.go
index 4e7f52c..f6a6948 100644
--- a/main.go
+++ b/main.go
@@ -58,6 +58,7 @@
 	datacollector scheduler
 	freqchan   chan uint32
         vendor string
+	protocol string
 }
 
 type Server struct {
@@ -130,14 +131,22 @@
 		case freq := <-freqchan:
 			ticker.Stop()
 			ticker = *time.NewTicker(time.Duration(freq) * time.Second)
+		case  err := <-s.dataproducer.Errors():
+			fmt.Println("Failed to produce message:", err)
 		case <-ticker.C:
 			for _, service := range redfish_services {
-				rtn, data := get_status(ip_address, service)
+				rtn, data := s.get_status(ip_address, service)
 				if rtn {
 					for _, str := range data {
 						str = "Device IP: " + ip_address + " " + str
+						fmt.Println("collected data  %s ...", str)
 						b := []byte(str)
-						s.dataproducer.Input() <- &sarama.ProducerMessage{Topic: importerTopic, Value: sarama.StringEncoder(b)}
+						msg := &sarama.ProducerMessage{Topic: importerTopic, Value: sarama.StringEncoder(b)}
+						// check if needs to add for select case
+						select {
+						case  s.dataproducer.Input() <- msg:
+							fmt.Println("Produce message")
+						}
 					}
 				}
 			}
@@ -158,20 +167,28 @@
 		},
 		freqchan:        make(chan uint32),
                 vendor: info.Vendor,
+		protocol: info.Protocol,
 	}
         //default_events := [...]string{}
 	s.devicemap[info.IpAddress] = &d
+	fmt.Println("size of devicemap %d", len(s.devicemap))
 	ip_address:= info.IpAddress
 	fmt.Println("Configuring  %s ...", ip_address)
 	// call subscription function with info.IpAddress
 	http.DefaultTransport.(*http.Transport).TLSClientConfig = &tls.Config{InsecureSkipVerify: true}
 	default_events := vendor_default_events[info.Vendor]
 	for _, event := range default_events {
-		rtn, id := add_subscription(ip_address, event)
+	if _, ok := s.devicemap[ip_address].subscriptions[event]; !ok {
+		rtn, id := add_subscription(info.Protocol+"://"+ip_address, event)
 		if rtn {
 			s.devicemap[ip_address].subscriptions[event] = id
 			fmt.Println("subscription added", event, id)
-		}
+			}
+                } else {
+                                log.WithFields(log.Fields{
+                                  "Event": event,
+                                }).Info("was  Subscribed")
+                        }
 	}
 	go s.collect_data(ip_address)
 	return &empty.Empty{}, nil
@@ -200,52 +217,49 @@
 	return nil
 
 }
+func (s *Server) kafkaCloseProducer(){
+	if err :=s.dataproducer.Close(); err != nil {
+		panic(err)
+	}
+
+}
 func (s *Server) kafkaInit() {
 	fmt.Println("Starting kafka init to Connect to broker: ")
 	config := sarama.NewConfig()
         config.Producer.RequiredAcks = sarama.WaitForAll
 	config.Producer.Retry.Max = 10
-	config.Producer.Return.Successes = true
 	producer, err := sarama.NewAsyncProducer([]string{"cord-kafka.default.svc.cluster.local:9092"}, config)
 	if err != nil {
 		panic(err)
 	}
 	s.dataproducer = producer
-	defer func() {
-		if err := producer.Close(); err != nil {
-			panic(err)
-		}
-	}()
 }
 
 func (s *Server) handle_events(w http.ResponseWriter, r *http.Request) {
 	signals := make(chan os.Signal, 1)
 	signal.Notify(signals, os.Interrupt)
 
+        fmt.Println(" IN Handle Event  ")
 	if(r.Method ==  "POST"){
 		Body, err := ioutil.ReadAll(r.Body)
 		if err != nil {
 			fmt.Println("Error getting HTTP data",err)
 		}
 		defer  r.Body.Close()
+		fmt.Println("Received Event Message ")
 		fmt.Printf("%s\n",Body)
 		message :=&sarama.ProducerMessage{
                         Topic: importerTopic,
                         Value: sarama.StringEncoder(Body),
                 }
-		select {
-		case s.dataproducer.Input() <- message:
-
-		case <-signals:
-	        s.dataproducer.AsyncClose() // Trigger a shutdown of the producer.
-		}
+		s.dataproducer.Input() <- message
 	}
 }
 
 func (s *Server) runServer() {
 	fmt.Println("Starting HTTP Server")
 	http.HandleFunc("/", s.handle_events)
-	http.ListenAndServe(":8080", nil)
+	http.ListenAndServeTLS(":8080", "https-server.crt", "https-server.key", nil)
 }
 
 func init() {
@@ -257,6 +271,7 @@
 	fmt.Println("Listening to  http server")
         log.Info("log Connecting to broker:")
         log.Info("log Listening to  http server ")
+	//sarama.Logger = log.New()
 }
 
 
@@ -266,6 +281,7 @@
 		devicemap:	make(map[string]*device),
 		devicechan:	make(chan *importer.DeviceInfo),
 	}
+	// check if we should keep this as go routines
 	go s.kafkaInit()
 	go s.runServer()
 	go s.startgrpcserver()
@@ -275,5 +291,6 @@
 	select {
 	case sig := <-quit:
 		fmt.Println("Shutting down:", sig)
+		s.kafkaCloseProducer()
 	}
 }
diff --git a/proto/importer.proto b/proto/importer.proto
index 2397e32..1ec491b 100644
--- a/proto/importer.proto
+++ b/proto/importer.proto
@@ -11,6 +11,7 @@
 	string ip_address = 1;
 	uint32 frequency = 2;
         string vendor = 3;
+	string protocol = 4;
 }
 
 message EventList {
