Hi Alex, yes thats correct, the creation of topics doesn't work, would you
raise a JIRA for this please? See
http://issues.apache.org/jira/browse/TUSCANY. If you're keen it shouldn't be
too hard to fix this, if you're interested in sending in a patch to fix it I
can give you any help you need, NP if not we'll get it done for you.

Note though, that the create attribute is not fully supported in a lot of
environments, see the comment at the bottom of
http://tuscany.apache.org/sca-java-bindingjms.html. There is some ActiveMQ
specific function so this can work when using ActiveMQ, so in this scenario
we can make this work.

You can also work around this right now by prefixing your topic names in the
SCDL with the string "dynamicTopics/" which tells ActiveMQ to create the
topic if it doesn't exist. The diff below shows the changes to the topic
test to do this.

   ...ant

Index: src/main/resources/jndi.properties
===================================================================
--- src/main/resources/jndi.properties  (revision 718645)
+++ src/main/resources/jndi.properties  (working copy)
@@ -33,6 +33,6 @@
 # register some topics in JNDI using the form
 # topic.[jndiName] = [physicalName]
 #topic.MyTopic = example.MyTopic
-topic.MyTopic = example.MyTopic
+#topic.MyTopic = example.MyTopic

 # END SNIPPET: jndi
Index: src/main/resources/topics/TopicsClient.composite
===================================================================
--- src/main/resources/topics/TopicsClient.composite    (revision 718645)
+++ src/main/resources/topics/TopicsClient.composite    (working copy)
@@ -28,7 +28,7 @@
     <reference name="serviceA" promote="OneWayClient/serviceA">
         <interface.java
interface="org.apache.tuscany.sca.binding.jms.OneWayService" />
         <binding.jms>
-            <destination name="MyTopic" type="topic" create="never"/>
+            <destination name="dynamicTopics/MyTopic" type="topic"
create="never"/>
         </binding.jms>
     </reference>

Index: src/main/resources/topics/TopicsService.composite
===================================================================
--- src/main/resources/topics/TopicsService.composite   (revision 718645)
+++ src/main/resources/topics/TopicsService.composite   (working copy)
@@ -24,7 +24,7 @@
         <implementation.java
class="org.apache.tuscany.sca.binding.jms.OneWayServiceImpl"/>
         <service name="OneWayService">
             <binding.jms>
-               <destination name="MyTopic" type="topic" create="never"/>
+               <destination name="dynamicTopics/MyTopic" type="topic"
create="never"/>
             </binding.jms>
         </service>
     </component>

On Wed, Nov 19, 2008 at 8:22 AM, <
[EMAIL PROTECTED]> wrote:

>
> Hallo Ant
>
> I found the problem. And I reckon it is either a bug or not yet
> implemented.
>
> Your test case defines the topic through the jndi.properties. If you
> comment the 'jndi topic declaration' and change the 'create' attribute to
> 'always' in the 'destination' declaration, a queue instead of a topic gets
> generated. I have attached an extended version of your test case, which aims
> proofs this (patch attached).
>
> Regards
> Alex
>
>
>
>
>
>  *"ant elder" <[EMAIL PROTECTED]>*
> Gesendet von: [EMAIL PROTECTED]
>
> 18/11/2008 19:21
>   Bitte antworten an
> [EMAIL PROTECTED]
>
>   An
> [EMAIL PROTECTED]
>  Kopie
> [email protected]  Thema
> Re: Re: binding.jms & destination type 'topic'
>
>
>
>
> You were correct, the warning you see is out dated and a red herring,  the
> code producing the warning looks like it was added during development before
> the type attribute was implemented and after it was implemented the warning
> didn't get correctly removed, so the warning still comes out even though the
> type attribute is processed correctly and using topics should work. Sorry
> for that confusion.
>
> I've added a test to show topics - *
> https://svn.apache.org/repos/asf/tuscany/branches/sca-java-1.x/itest/jms-topics/
> *<https://svn.apache.org/repos/asf/tuscany/branches/sca-java-1.x/itest/jms-topics/>
>
> Can you compare that test code to the code you have to see if there are any
> obvious differences that could be causing a problem? If you want to send a
> zip of your code I'd be happy to have a look for whats going wrong.
>
>   ...ant
>
> On Tue, Nov 18, 2008 at 3:55 PM, <*
> [EMAIL PROTECTED]<[EMAIL PROTECTED]>>
> wrote:
>
> Hi Ant
>
> What I did:
> - Got a snapshot of the tuscany sources (not today, already a couple of
> days back).
> - Loaded everything into Eclipse,  including
>        - sample-helloworld-service-jms
>        - sample-helloworld-reference-jms
> - once I had established that these two communicate in their vanilla state,
> I applied some changes:
>        - disabled the embedded ActiveMQ instance, providing my own
>        - changed the HelloWorldService.getGreetings to return void
>        - marked it with org.osoa.sca.annotations.OneWay
>        - added 'type="topic"' to all '<destination.../>' definitions in the
> composite declarations
>        - commented everywhere the declaration of the '<response.../>'
> declaration
>
> Now if I run either one of the projects, I get messages of the kind:
> 18-Nov-2008 16:40:51
> org.apache.tuscany.sca.binding.jms.impl.JMSBindingProcessor
> WARNING: JMS Binding doesn't process destination type yet
>
> Additionally, looking into ActiveMQ via JMX reveals that a 'queue' is being
> created instead of a 'topic'.
>
> Now I had a quick look into the tuscany code as well, but not too deeply.
> The JMSBindingProcessor actually seems to parse the 'type' argument, but
> still complains about it (see above log message). I did not look for the
> place where the 'JMS destination' is created, and at a first glance simply
> assumed, "hmm, maybe the warning is simply outdated". Anyhow, looking into
> ActiveMQ somehow proofs that a queue is being created.
>
> Beside that there are no exceptions. Everything seems to be working (since
> so far I only run once service consumer ...).
>
> Regards
> Alex
>
> PS: I could provide a zip with the two projects if you require, just takes
> some time on my side to simply verify the above again (did not expect anyone
> to contest the 'maybe' missing functionality question).
>
>
>   *"ant elder" <[EMAIL PROTECTED] <[EMAIL PROTECTED]>*>*
>
> 18/11/2008 16:27
>
>
>   Bitte antworten an*
> [EMAIL PROTECTED] <[EMAIL PROTECTED]>
>
>   An
> [EMAIL PROTECTED] <[email protected]>  Kopie
> [EMAIL PROTECTED]<[EMAIL PROTECTED]>
> Thema
> Re: binding.jms & destination type 'topic'
>
>
>
>
>
>
>
>
> On Mon, Nov 17, 2008 at 9:53 AM, <*
> [EMAIL PROTECTED]<[EMAIL PROTECTED]>>
> wrote:
>
> Hi All
>
> I have tried to use the binding.jms via topics (even with the current head
> version). However, this seems not to be implemented yet. My question now is:
> Are there any plans to implement this in the very very near future, or would
> this require a bigger effort that it has not been tackeled yet?
>
> Regards
> Alex Chatziparaskewas
>
> I thought this should work, what are the problems you see when using
> topics, could you give a bit more detail, stack traces or error messages?
>
>  ...ant
>
>

Reply via email to