Hi,

sorry I haven't replied before but I'm on holidays at the moment. Someone
in my team may have tried it already but I won't know until next Tuesday.
I'll reply back once I get back to work.

Thanks.


2016-08-08 11:50 GMT+02:00 vdpyatkov [via Apache Ignite Users] <
ml-node+s70518n6848...@n6.nabble.com>:

> Hello,
>
> I try to reproduce your issue, but my code not hangs.
> See attachment example.
>
> On Fri, Aug 5, 2016 at 7:03 PM, juanma.cvega <[hidden email]
> <http:///user/SendEmail.jtp?type=node&node=6848&i=0>> wrote:
>
>> Hi,
>>
>> I already replied to the confirmation email twice. Is there any other
>> thing
>> I have to do?
>>
>> The place were it hangs is when calling
>> ignite.services().deploy(serviceConfiguration()) from inside the bean
>> IgniteClusterSingletonStarter. The full code is in the first post. If I
>> remove that bean and simply provide ServiceConfiguration in the
>> IgniteConfiguration bean (code is also in the first post), I can see it's
>> registered by the logs from inside the init() method in the TestService
>> implementation. So basically, registering the cluster singleton through
>> xml
>> configuration before create the Ignite instance works. If I create the
>> Ignite instance and then try to create the cluster singleton it hangs.
>> I don't know exactly what you mean with reusing IgniteConfiguration,
>> CommunicationSPI and discoverySPI, sorry. The whole Ignite configuration
>> is
>> attached in the first post. From there, what I do in some beans is inject
>> the Ignite instance to create a queue, a topic and listeners to node
>> events.
>> This is the code for that. The only part missing in the code is the
>> cluster
>> singleton that should produce messages to the distributed queue:
>>
>> public TopicSubscriber(Ignite ignite,
>>                                                 String topicName,
>>                                                 Service service){
>>       this.service = service;
>>       this.ignite = ignite;
>>       this.topicName = topicName;
>>    }
>>
>>    @PostConstruct
>>    private void initSubscriber() {
>>       ignite.message(ignite.cluster().forRemotes()).localListen(to
>> picName,
>> (uuid, deleteRequest) -> {
>>          service.remove((Request) deleteRequest);
>>          return true;
>>       });
>>    }
>>
>> public class EventListener {
>>
>>    private final Service service;
>>    private final IgniteEvents igniteEvents;
>>
>>    public PriceChangeAlertClusterEventListener(IgniteEvents igniteEvents,
>>                                                Service service) {
>>       this.service = service;
>>       this.igniteEvents = igniteEvents;
>>    }
>>
>>    @PostConstruct
>>    private void initializeEventsListener() {
>>       igniteEvents.localListen(this::clearSubscriptions,
>> EventType.EVT_NODE_FAILED, EventType.EVT_NODE_JOINED,
>> EventType.EVT_NODE_LEFT);
>>    }
>>
>>    private boolean clearSubscriptions(Event event) {
>>       service.unsubscribeAll();
>>       return true;
>>    }
>>
>> public QueueConsumer(Service service
>>                                         IgniteQueue<QueueObject> queue) {
>>       this.service = service;
>>       this.queue = queue;
>>    }
>>
>>    @PostConstruct
>>    private void startConsuming() {
>>       Executors.newFixedThreadPool(1).execute(() ->
>> service.update(queue.take()));
>>    }
>>
>>
>> The implementation of TestService is basically this
>>
>> public class TestService implements Service {
>>    @Override
>>    public void cancel(ServiceContext ctx) {
>>       log.info("Cancle");
>>    }
>>
>>    @Override
>>    public void init(ServiceContext ctx) throws Exception {
>>       log.info("Init");
>>    }
>>
>>    @Override
>>    public void execute(ServiceContext ctx) throws Exception {
>>       log.info("execute");
>>    }
>> }
>>
>> Thanks.
>>
>>
>>
>> --
>> View this message in context: http://apache-ignite-users.705
>> 18.x6.nabble.com/Deploying-service-programmatically-hangs-
>> the-app-tp6791p6807.html
>> Sent from the Apache Ignite Users mailing list archive at Nabble.com.
>>
>
>
>
> --
> Vladislav Pyatkov
>
> *DeployingService.zip* (6K) Download Attachment
> <http://apache-ignite-users.70518.x6.nabble.com/attachment/6848/0/DeployingService.zip>
>
>
> ------------------------------
> If you reply to this email, your message will be added to the discussion
> below:
> http://apache-ignite-users.70518.x6.nabble.com/Deploying-
> service-programmatically-hangs-the-app-tp6791p6848.html
> To unsubscribe from Deploying service programmatically hangs the app, click
> here
> <http://apache-ignite-users.70518.x6.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=6791&code=anVhbm1hLmN2ZWdhQGdtYWlsLmNvbXw2NzkxfDI5MjY5MzI4MQ==>
> .
> NAML
> <http://apache-ignite-users.70518.x6.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>




--
View this message in context: 
http://apache-ignite-users.70518.x6.nabble.com/Deploying-service-programmatically-hangs-the-app-tp6791p7133.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Reply via email to